Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Scott Miller
* Thus wrote Scott Miller ([EMAIL PROTECTED]): I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it won't work. The code works on smaller files, but not this one. Can

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Oliver Hankeln
Scott Miller wrote: * Thus wrote Scott Miller ([EMAIL PROTECTED]): I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it won't work. The code works on smaller files, but not this

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Scott Miller
- Original Message - From: Oliver Hankeln [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:13 AM Subject: Re: [PHP] Read Last Lines of a Text File Scott Miller wrote: * Thus wrote Scott Miller ([EMAIL PROTECTED]): I have a text file (log file) that I want

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Oliver Hankeln
Scott Miller wrote: I've changed my script to the following: ?php $file =/var/log/radius.log; $fp = popen(/usr/bin/tail -$limit $file, 'r'); if (! $fp ) { echo 'unable to pipe command'; } while (!feof($fp) ) { $line = fgets($fp); print $line; } ? And now get the following errors: Warning: Wrong

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Scott Miller
- Original Message - From: Oliver Hankeln [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:29 AM Subject: Re: [PHP] Read Last Lines of a Text File Scott Miller wrote: I've changed my script to the following: ?php $file =/var/log/radius.log; $fp

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Daniel Clark
Try adding number of bytes to read. $line = fgets($fp, 4096); * Thus wrote Scott Miller ([EMAIL PROTECTED]): I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Oliver Hankeln
Scott Miller wrote: - Original Message - From: Oliver Hankeln [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:29 AM Subject: Re: [PHP] Read Last Lines of a Text File Scott Miller wrote: I've changed my script to the following: ?php $file =/var/log/radius.log

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Scott Miller
- Original Message - From: Oliver Hankeln [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 17, 2004 10:01 AM Subject: Re: [PHP] Read Last Lines of a Text File Scott Miller wrote: - Original Message - From: Oliver Hankeln [EMAIL PROTECTED] To: [EMAIL

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Matt Matijevich
[snip] ?php $file =/var/log/radius.log; $fp = popen(/usr/bin/tail -$limit $file, 'r'); if (! $fp ) { echo 'unable to pipe command'; } while (!feof($fp) ) { $line = fgets($fp, 4096); print $line.br; } ? I've tried bumping up the 4096 to a higher number because it currently only shows me

Re: [PHP] Read Last Lines of a Text File

2004-06-17 Thread Scott Miller
[snip] ?php $file =/var/log/radius.log; $fp = popen(/usr/bin/tail -$limit $file, 'r'); if (! $fp ) { echo 'unable to pipe command'; } while (!feof($fp) ) { $line = fgets($fp, 4096); print $line.br; } ? I've tried bumping up the 4096 to a higher number because it

Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Matt Matijevich
[snip] I've created the code below, but since this file is so large (currently 8 MB) it won't work. [/snip] I would guess you are running into your php memory_limit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Matt Grimm
[EMAIL PROTECTED] (Scott Miller) wrote in news:[EMAIL PROTECTED]: I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it won't work. The code works on smaller files, but not

Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Ashwin Purohit
Or maybe execution time limit. [snip] I've created the code below, but since this file is so large (currently 8 MB) it won't work. [/snip] I would guess you are running into your php memory_limit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Curt Zirzow
* Thus wrote Scott Miller ([EMAIL PROTECTED]): I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it won't work. The code works on smaller files, but not this one. Can someone