fh is not passed to read()
Hello, I try to inspire me from megaFS (it look like it use the same API version that is write in the wiki).
https://github.com/ju1i3nm/MegaFS/blob/master/megafs.py#L83
So I do the same in my code for open()
def open(self, path, flags):
# ~ st = fuse.FuseFileInfo()
# ~ setattr(st, 'direct_io', True)
# ~ setattr(st, 'nonseekable', True)
(tmp_f, tmp_path) = tempfile.mkstemp(prefix='syno_')
os.close(tmp_f)
if self.fl.get_file(path, mode='download', output=tmp_path):
return open(tmp_path, "rb")
And I use that for my read()
def read(self, path, size, offset, fh):
fh.seek(offset)
return fh.read(size)
But python is complaining because fh is required argument.
Did I do something wrong, maybe I missed something in the wiki.
Thanks for your help.
Can you provide a minimum code example reproducing your error ?
Hello @sdelafond
Sorry for my late reply.
I can provide the class I'm writing but it's for Synology. I'm not sure it could help you without having one.
The main issue is that python not accept that I pass "fh" in my read arguments. Maybe I not use the good method (it's my first code with Fuse).
the way i see it, read has 3 arguments
def read(self, path, size, offset):
- https://github.com/libfuse/python-fuse/blob/fe0c41795cbbbc6de6350f30885c694e8b050f24/example/cups.py#L93
you providing extra parameter of results an error.
so, yes. providing source code would have shown exactly what you were doing in your code. also, you should show your error, that would have left less guess-work here.
Hello @glensc
Thanks for your answer. I wrote the code multiple years ago, and it was for a friend that I don't even have any contact with, so I would not be able to test it again.
I will close the issue because there is a big chance I will not come back to it, thanks to remembering me this issue, so I can close it properly.
🚧 Never link to branches, share a permalink 🚧
- see https://news.ycombinator.com/item?id=8046710 and https://help.github.com/articles/getting-permanent-links-to-files/ and https://docs.gitlab.com/ee/user/shortcuts.html#project-files
- hit
y - and perhaps for https://github.com/josephfrazier/octopermalinker (GitHub)
NOTE: edit your post and fix it with a permalink!
Hello @glensc
Thanks for your concern and I didn't know it, thanks for letting me know. But I don't appreciate the note, so instead you got the removing of the link because it doesn't alter the fact that I will not try to find my code back.
Cheers
But I don't appreciate the note, so instead you got the removing of the link because it doesn't alter the fact that I will not try to find my code back.
Sorry about the tone of that "note" indeed, and thanks for having taken the time to add extra information to that super old issue: that was much appreciated!