Re: preventing pipe reader from existing on writer exiting

2009-10-06 Thread Marc Herbert
Brian J. Murrell a écrit : > > Can anyone help? Ultimately I need to do I/O through a named pipe and I > need to be able to restart the writer without restarting the reader. Have a look at socat. It solved all my FIFO problems.

Re: preventing pipe reader from existing on writer exiting

2009-10-01 Thread Andreas Schwab
"Brian J. Murrell" writes: > But this is where (simplified) my example using cat went sideways. :-( > In my real world use, the first cat is actually mplayer and doesn't have > the option of writing to stdout instead of a named file for this > particular use of it. Perhaps you can use /dev/stdo

Re: preventing pipe reader from existing on writer exiting

2009-10-01 Thread Brian J. Murrell
On Wed, 2009-09-30 at 23:13 +0200, Andreas Schwab wrote: > > Just make sure the write side of the pipe is not closed prematurely. Hrm. Yes, of course. John's solution of having a null writer keeping it open is one way -- which I might just use. > $ (n=0; while [ $n -lt 10 ]; do cat /dev/zero;

Re: preventing pipe reader from existing on writer exiting

2009-09-30 Thread John Reiser
Ultimately I need to do I/O through a named pipe and I need to be able to restart the writer without restarting the reader. The reader of a fifo will not be terminated as long as there is at least one writer to the fifo. Therefore, create a second writer. For example, to hold the fifo open for

Re: preventing pipe reader from existing on writer exiting

2009-09-30 Thread Andreas Schwab
"Brian J. Murrell" writes: > Can anyone help? Ultimately I need to do I/O through a named pipe and I > need to be able to restart the writer without restarting the reader. Just make sure the write side of the pipe is not closed prematurely. $ (n=0; while [ $n -lt 10 ]; do cat /dev/zero; let n=

preventing pipe reader from existing on writer exiting

2009-09-30 Thread Brian J. Murrell
Let's say I have the following (contrived, simplified example): $ mknod /tmp/fifo $ cat /dev/zero > /tmp/fifo & $ cat < /tmp/fifo When the first cat exits (i.e. is terminated) the second cat stops. The problem is that I want to be able to restart the first cat and have the second cat just keep r