EtiennePerot / fuse-jna

No-nonsense, actually-working Java bindings to FUSE using JNA.
http://fusejna.net/
Other
137 stars 43 forks source link

Callback 'getattr' is called with non-existing path #56

Closed zxkane closed 9 years ago

zxkane commented 9 years ago

I am using fuse-jna library to create a custom FS. When debugging my code, the callback readdir was called firstly when cd or ls a folder. It works fine. In my readdir implementation, some files and folder in that dir path were found, for example,

/js
/css
/images

However the callback getattr were called many times for known(in above list) and unknown path(at least they were not returned by the callback readdir).

For example, I did see below path in getattr callback,

/.git  on both Linux and Mac OSX
/objects on Linux
/._. on MacOSX
/.DS_Store on Mac OSX

Do you have any idea why callback getattr were called with above non-existing path? They are annoying and might impact the performance.

centic9 commented 9 years ago

I believe these are accesses done by the operating system which probes for "hidden" stuff that is used for some operating system specific functionality, e.g. caches, meta-data, trash-can, ...

I saw similar accesses in my project which uses fuse-jna and there I ignored those that I encountered, see IGNORED_DIRS

zxkane commented 9 years ago

@centic9 Thanks for your explanation. Your project JGitFS really inspired me a lot when I am writing my project.

EtiennePerot commented 9 years ago

Yes, those are indeed just probes by your operating system, file manager, and whatever you have running on your machine. They do that to every filesystem, and they all have to handle that.