Just something I’d like to play with, I would like to create a “virtual” file/directory in the File System of Linux or Mac OS X (Not sure if I can share the same code – does POSIX help?), for example /foo and then perform custom code when something is read or written to it.
Similar how /dev/null allows for stuff like
echo "Hello!" > /dev/null
I don’t care if it’s in /dev, /proc or anywhere else, as said it’s mainly something to play with…
FUSE. If you use FUSE to write a filesystem (using the built-in support in Linux and MacFUSE on the Mac), you can mount it anywhere. Your userland code will be invoked and you can do whatever you want.