I'm trying to write a test case for some code that should iterates over a filesystem tree, but should stop if a file is on another device. In writing tests for it, I considered creating a file in /dev/shm
, symlinking to it from my test directory, and then checking that it isn't read, but /dev/shm
seems to be Linux-specific. mount
-ing a tmpfs
could be an option, but it requires root...
Any ideas how this can be accomplished?