>Unfortunately, the open fails unless there is somebody reading from
>the fifo- It is possible to open a fifo for read without blocking, but
>I couldn't find any way to do this for writing. For reading, it also
>seems to be possible to ge a signal if data is available, but I can't
>think of any way to get such a signal if the pipe is opened for
>reading (so I could afterwards open it for writing).
>

Hello,

>From the perlipc.pod,

A fifo is convenient when you want to connect a process to an unrelated one. 
When you open a fifo, the program will block until there's something on the 
other end.

For example, let's say you'd like to have your .signature file be a named pipe 
that has a Perl program on the other end. Now every time any program (like a 
mailer, news reader, finger program, etc.) tries to read from that file, the 
reading program will block and your program will supply the new signature. 
We'll use the pipe-checking file test -p to find out whether anyone (or 
anything) has accidentally removed our fifo.


So I think there is no way but you just need to keep another program to be 
reading from the FIFO when you're writing to it.


--
Books below translated by me to Chinese.
Practical mod_perl: http://home.earthlink.net/~pangj/mod_perl/
Squid the Definitive Guide: http://home.earthlink.net/~pangj/squid/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to