This may not be possible, but... I have a 3rd party app (mumble for the curious) that can be told to open a file for write (I provide the name), and dump bytes into it until told to stop. It doesn't open the file for append and if the file already exists it changes the name and tries again. All well, good and fairly standard. It can write for hours (and will happily fill the disk, which is the problem).
I want to intercept everything it writes and read it from another process; ideally it would never get to disk at all, but I'll accept compromises where some of it does.
The obvious solution, to read the file as it's written, truncate() what I read and read again, won't work for me, because the file won't get smaller when I truncate - mumble doesn't specify append, so it will keep writing where it left off. Ideally I need some way to fool it into thinking it created and is writing a normal file, while really it's just piping it all to me. I don't want to write my own filesystem code for this (unless that's much easier than it looks).
Ultimately I want to get the recorded sound, hash it up and feed it to /dev/random. Just pointing mumble to /dev/random doesn't work because /dev/random exists, so it won't use it.
is there a clever trick for this? If not is there any way to write userland code that looks like a directory? If all else fails, is it fairly simple to write a filesystem that can do what I need?