1

I'm writing my own toy file system with FUSE (OSXFUSE on Mac OS X and libfuse on Linux). Each time I mount the file system, FUSE calls getattr on some special paths, as the log shows:

[debug] trfs_getattr: called on path=/
[debug] trfs_getattr: called on path=/._.
[error] get_entry_attr: no entry at path /._.
[debug] trfs_getattr: called on path=/.hidden
[error] get_entry_attr: no entry at path /.hidden
[debug] trfs_getattr: called on path=/._.
[error] get_entry_attr: no entry at path /._.
[debug] trfs_getattr: called on path=/._.
[error] get_entry_attr: no entry at path /._.
[debug] trfs_getattr: called on path=/._.
[error] get_entry_attr: no entry at path /._.
[debug] trfs_getattr: called on path=/.hidden
[error] get_entry_attr: no entry at path /.hidden

Function trfs_getattr() is my own implementation of the getattr() callback in struct fuse_operations.

Function get_entry_attr() is used for getting the attributes of a file, and it reports error because it cannot locate the corresponding file at that path.

It seems like FUSE automatically tries to call getattr() on some special hidden files/directories, and this happens only on Mac OS X. The log output is normal on Linux.

Questions * What are those special files? * Why FUSE calls getattr() on those paths first? * How to prevent this on Mac OS X?

pjhades
  • 1,948
  • 2
  • 19
  • 34
  • 1
    Why do you think it's FUSE doing it rather than the OS doing it when a volume is mounted? Why do you want to prevent it? Why do you care? Just fail like for any other attempt to access a non-existent file. Surely, your file system implementation has to handle that. – Ken Thomases Jul 10 '16 at 01:56

2 Answers2

1

Those ._* files are not created by fuse or your filesystem directly, it's a Mac OS X feature, see: https://apple.stackexchange.com/questions/14980/why-are-dot-underscore-files-created-and-how-can-i-avoid-them

marbu
  • 1,939
  • 2
  • 16
  • 30
0

It's not Fuse, it FS itself. It uses get_attr to check files existents at path.

DoN1cK
  • 595
  • 7
  • 22