Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python fuse中的双读调用导致EINVAL_Python_Fuse - Fatal编程技术网

python fuse中的双读调用导致EINVAL

python fuse中的双读调用导致EINVAL,python,fuse,Python,Fuse,我在使用python fuse时遇到问题。以下是该问题的一个独立示例: 在安装伪内存文件系统时,我可以列出内容,但我可以读取文件: > ls -al ~/temp/mount/ total 1 -r--r--r-- 1 user group 34 Aug 3 22:44 test.txt > cat ~/temp/mount/test.txt cat: /home/user/temp/mount/test.txt: Invalid argument 当我在前一轮(-d)中运行保

我在使用python fuse时遇到问题。以下是该问题的一个独立示例:

在安装伪内存文件系统时,我可以列出内容,但我可以读取文件:

> ls -al ~/temp/mount/
total 1
-r--r--r-- 1 user group 34 Aug  3 22:44 test.txt
> cat ~/temp/mount/test.txt 
cat: /home/user/temp/mount/test.txt: Invalid argument
当我在前一轮(-d)中运行保险丝fs时,我得到以下调试信息:

LOOKUP /test.txt
getattr /test.txt
   NODEID: 2
   unique: 120, success, outsize: 144
unique: 121, opcode: OPEN (14), nodeid: 2, insize: 48, pid: 10342
open flags: 0x8000 /test.txt
   open[0] flags: 0x8000 /test.txt
   unique: 121, success, outsize: 32
unique: 122, opcode: READ (15), nodeid: 2, insize: 80, pid: 10342
read[0] 4096 bytes from 0 flags: 0x8000
   unique: 122, error: -22 (Invalid argument), outsize: 16
unique: 123, opcode: READ (15), nodeid: 2, insize: 80, pid: 10342
read[0] 4096 bytes from 0 flags: 0x8000
   unique: 123, error: -22 (Invalid argument), outsize: 16
unique: 124, opcode: FLUSH (25), nodeid: 2, insize: 64, pid: 10342
   unique: 124, error: -38 (Function not implemented), outsize: 16
unique: 125, opcode: RELEASE (18), nodeid: 2, insize: 64, pid: 0
release[0] flags: 0x8000
   unique: 125, success, outsize: 16
我的日志文件有:

INFO:fakefs:open fake file /test.txt
INFO:fakefs:read from /test.txt, offs 0, size 4096, len 34
INFO:fakefs:read remainder
INFO:fakefs:read() = 34 bytes
INFO:fakefs:read from /test.txt, offs 0, size 4096, len 34
INFO:fakefs:read remainder
INFO:fakefs:read() = 34 bytes
INFO:fakefs:released(/test.txt) = 0
我想知道的是: 1) 为什么要执行两次读取(从0标志读取[0]4096字节:0x8000) 2) 为什么它会返回艾因瓦尔?我返回数据-我的代码中没有单个EINVAL


在实际示例中,我也在实现其余的fs函数,这不是问题所在。

结果表明,这与Python2中编码的复杂处理有关(py3没有python fuse)


在read()中返回字节(buf)可以修复它。fuse代码在从python端接收到错误信息时也会使用EINVAL。

结果表明,它与Python2中复杂的编码处理有关(py3没有python fuse)

在read()中返回字节(buf)可以修复它。fuse代码在从python端收到错误消息时也会使用EINVAL