I have a named pipe file that looks like this:
prw-r--r-- 1 root root 0 Aug 11 17:01 /tmp/debug
When I do something like this in PHP:
$fp = fopen("/tmp/debug", "r");
It hangs (i.e. never returns). Is there a way to make this call return and/or timeout?
(edit)
Note that I want one process opening this pipe with write permissions, and another process opening the pipe with read permissions. Someone is writing to this pipe while someone else is reading from this pipe. The issue is that the reader is sometimes hanging on the fopen() -- which I always want to return, whether it was successful or not.