Is there a posibility in PHP
- to read a file as stream
- or to specefy a timeout for reading files as it is with streams
- or a way to find out wether a file has data in it without EOF
i try to read from /dev/random wich is no problem as long as it is not empty.
But if it is empty it does not return a EOF but hangs the script till there is more data.
filesize() always returns 0.
here is a little funktion showing what i try to do (off cause it doesn’t work as there is no timeout for files):
$info = stream_get_meta_data($fp);
while(count($rand)<$length and isset($info[‘timed_out’]) and !$info[‘timed_out’]);
i try to get this to work for hours.
i’m thankfull for any ideas.