Finder can be picky about what it thinks is legit or not. In the past I’ve had plenty of issues with Finder deciding to not show anything because the data it got back from my file system was inconsistent.
What I’d personally do is run your file system in debug mode and see exactly what FS operations are being called and what is being returned. It’s possible that there is a call to your filesystem for some folder metadata that is being returned in such a way that Finder is assuming it doesn’t exist.
Also keep in mind that Mac OS X’s VFS layer is slightly different to the Linux VFS layer and there are different behaviours that aren’t 100% compatible. IMHO OSXFUSE does a good job of isolating a lot of that but there are various system calls that outright behave differently on the two OS’s that makes development a pain.
I copied your code and tried to compile as is with the latest non developer version of OSXFUSE however I got the standard FUSE version error. I modified it slightly to fix that (adding a def for FUSE_USE_VERSION ahead of the fuse.h import) and it compiled.
pancake:osxfuse_hello pasamio$ ./hello -d -s mount
unique: 0, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.8
flags=0x00000000
max_readahead=0x00100000
init
INIT: 7.8
flags=0x00000000
max_readahead=0x00100000
max_write=0x01000000
unique: 0, error: 0 (Undefined error: 0), outsize: 40
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: ACCESS (34), nodeid: 1, insize: 48
ACCESS / 00
unique: 0, error: -78 (Function not implemented), outsize: 16
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: GETATTR (3), nodeid: 1, insize: 40
getattr, path: /
unique: 0, error: -2 (No such file or directory), outsize: 16
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
(repeated a lot more times)
What is probably actually causing the problems is that there is a getattr call on the root path that returns it doesn’t exist (repeating below):
Now if I’m Finder (or really the OS) and go “Hey, what’s at the root” and the FS goes “nothing” then I’m going to pretend it doesn’t exist. My guess is this is what is happening with Finder.