tail - alike weirdness in php

Top Page
Author: Bopolissimus Platypus
To: PHP Web Development
Subject: tail - alike weirdness in php
hello all,

i ran across something weird when i was writing something that sits on a
file and sort of works like "tail -f".

when you do something like this:


when you get to the end of the loop, feof($fp) is true.
now, if the file is being updated (e.g., it's a log file)
then the file might not actually be at end of file anymore.
however, your $fp filehandle still thinks that it is (at eof).

in C, you would call clearerr(FILE *) to clear the
eof flag. there doesn't seem to be anything similar
in PHP. has anyone come across something like

finally, what i had to do was:


and that clears the eof flag.


Gerald Timothy Quimpo gquimpo*hotmail.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"

    In necessariis unitas, in dubiis, libertas, 
     in omnibus caritas

PHP Web Development Mailing List
php@??? (#PHP @ irc.free.net.ph)
Searchable Archives: http://marc.free.net.ph