Creating a "virtual" path (/bla) in Mac OS X and Linux that calls custom code

Posted by Michael Stum on Stack Overflow See other posts from Stack Overflow or by Michael Stum
Published on 2010-05-25T00:39:51Z Indexed on 2010/05/25 0:51 UTC
Read the original article Hit count: 180

Filed under:
|
|

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...

© Stack Overflow or respective owner

Related posts about linux

Related posts about macosx