Now, it does work, but only ONCE, so the process which has
its stdin redirected to </dev/fifo exits with error level 0.
Also the pair:
cat whatever >/dev/fifo
cat </dev/fifo >myfile
works fine.
My wish is to keep the collector process going indefinitely, possibly in the
background.
Anyone care to comment?
Laszlo
That's how a fifo is supposed to work as far as I can tell: when all
writers have exited, the reader gets an EOF and also exits..
>My wish is to keep the collector process going indefinitely, possibly in the
>background.
>Anyone care to comment?
You could try either:
while true; do cat /dev/fifo; done > quotes &
which restarts the cat every time, but it might be more clever to do
something like:
sleep 100000 > /dev/fifo &
cat /dev/fifo > quotes &
which puts a writer on the fifo that doesn't do anything, but which
makes sure the reader never exits due to the fifo not having any
writers. Then you can just write to the fifo every now and then and
collect all the writings into the "quotes" file.
Linus
| Now, it does work, but only ONCE, so the process which has
| its stdin redirected to </dev/fifo exits with error level 0.
|
| Also the pair:
| cat whatever >/dev/fifo
| cat </dev/fifo >myfile
| works fine.
|
| My wish is to keep the collector process going indefinitely, possibly in the
| background.
| Anyone care to comment?
When the process writing the FIFO closes it the process reading the FIFO
get an EOF. That's the way it works in UNIX as far as I remember.
--
Bill Davidsen, davidsen%sixhu...@uunet.uu.net
TMR Associates, +1 518-370-5654
C programming, training, data gathering, porting to open systems,
heterogeneous environments, computer controlled housing, custom software