Why might fclose() block?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm currently seeing this in 5.3.10, although it's an intermittent
problem I've seen earlier versions too. Occasionally I get a "maximum
execution time" error when calling fclose() on a parallel port file
descriptor. Code looks like this:

$fp = fopen('/dev/lp0','w');
if ($fp){
   fwrite($fp,$LongStringOfData);
   fclose($fp);
}

The printer attached to the parallel port does print the data sent in
the fwrite line and the execution time error identifies the fclose
line. It does not appear to be OS dependent. I've seen the error in
both CentOS and Ubuntu as well as Windows (with LPT1: instead of
/dev/lp0).

What could cause fclose() to block rather than fail and return False?
Is there anything vaguely equivalent to socket_select that I can use
to wait for a blocking file descriptor with a specified timeout?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux