Closed nduong-ol closed 3 months ago
I do not believe that this is possible with the regular FUSE API.
WinFsp on Windows and FUSE low-level on UNIX do have the capability to satisfy a readdir asynchronously. But this capability cannot be exposed via the regular FUSE API.
Is it possible to modify the current fuse API of cgofuse to make it possible? If yes, can you give me some pointers on how it could be done?
As said this is not possible within the FUSE high-level API.
For Windows you would have to use the native WinFsp API. For UNIX you would have to use the FUSE low-level API. In either case cgofuse would not be of much help to you.
Which Winfsp API should I use to implement this async mechanism?
You would use the native WinFsp API:
https://github.com/winfsp/winfsp/wiki/WinFsp-API-winfsp.h
See the ReadDirectory
operation.
Thanks for the pointer. After digging a little bit, I found previous issue on rclone that mentioned that with the FileSystemHost.Notify() we can trigger the file explorer to reload the directory when we have new element available right?
Yes, that's possible.
Is the FileSystemHost.Notify() function only works on Windows? I saw the NotifyFs only made available for Windows. I tried to used this function on Mac but I wouldn't see the same effect as on windows, the Notify() return false. Could you tell me if I'm missing something?
The notify functionality is only available on Windows. It is a WinFsp extension not available on FUSE.
Do you have any recommendation on how we can port it to Fuse? I would make a PR to have this function available for Fuse
Hello @billziss-gh with winfsp on windows, I only manage to notify the file explorer that there is a new file when emit an event on the specific file. The file explorer seems to add only the file indicated in the event instead of reloading the whole folder. This cause a few issue when I have a lot of files popping up, the file explorer tent to ignore these events. Is there anyway I can trigger a full reload of the file explorer instead of it just adding a single file per event at a time?
Hello, I'm experimenting with cgofuse and winfsp to mount a cloud file system into windows. I'm noticing that when a folder is open through the file explorer, Readdir is called and a function fill() is passed as parameter for Readdir to fill the children attribute. If a folder is very large (hundred thousands children) the Readdir gonna take quite some times waiting for all the fill to complete. I don't know if there is any possibility to render the folder asynchronously (return the Readdir and then fill the children gradually and make the file explorer render gradually received children)?