Read file backwards
| From: | Kim Steinhaug | Date: | Sat, 10 Apr 2004 15:55:16 +0000 |
| Subject: | Read file backwards | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-183072@lists.php.net to get a copy of this message | ||
Anyone have a script that reads a file backwards? Im looking for
a way to trace a log file, say the last 30 lines each time I run the script.
I havnt found any DOS tools so I guess doing it in PHP will be just as
fine, and Im on a Win32 platform.
I could however read the entire file, and count the files and show the
last lines, but this wouldnt really read it backwards and would work
very "foolishly" on large files I would think.
If there isnt a way of doing this Ill have to do the above, but you never
know. Ill google in the meantime.
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------