You are not logged in.
I think this can be done with FUSE (i.e. I think this is basically what EncFS is doing), but I'm not sure, hence the question:
How could I create a "fake" file that would pass anything written to it to a process, and call upon the process to get data whenever the file is read? This should work transparently so that the system treats the file just like any other file, thus enabling it to be used with any application.
Is there already something that can do this?
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
You could probably do something similar with "mkfifo", which makes a named pipe. You can run something like:
mkfifo fakefile
Then you could do something like
less -f fakefile
less, cat, or any other program will block until the other end of the pipe is connected. Then run something like:
cat > fakefile
in another terminal, and start typing. The lines should print in the other terminal.
EDIT: Changed my example to something a bit more interesting.
Last edited by tom5760 (2009-01-08 04:10:42)
Offline
The problem with fifo's is that the data has to be being read before data is put in there... That's my experience with trying to get it working with these threads:
http://bbs.archlinux.org/viewtopic.php?id=60779
http://bbs.archlinux.org/viewtopic.php?id=60684
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
The problem with fifo's is that the data has to be being read before data is put in there... That's my experience with trying to get it working with these threads:
http://bbs.archlinux.org/viewtopic.php?id=60779
http://bbs.archlinux.org/viewtopic.php?id=60684
I'm not too sure about this, since I've just learned about pipes today from this thread
But, I tried creating a pipe, then catting to it before using less...and it worked. less read the data that I had already wrote to it with cat, and continued displaying data when I wrote more to it with cat.
Offline
The problems I was having might have just been related to arecord / oggenc... When I did it, i had to start oggenc first, then arecord, but when I killed oggenc to start a new instance to a new output file, arecord would detect that ogggenc had died and would die also... *shrugs*
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
tom5760,fukawi2
Thank you, that seems to be exactly what I had in mind!
*runs off to play with mkfifo*
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline