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

2004-06-17 Thread Scott Miller
> [snip] > > $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.""; > > > } > ?> > > I've tried bumping up the 4096 to a higher numb

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

2004-06-17 Thread Matt Matijevich
[snip] "; } ?> I've tried bumping up the 4096 to a higher number because it currently only shows me 10 lines - I'd like to see about 30. No matter what I change the number to, it still only shows 10 lines. What do I need to do to get more that the 10 lines? [/snip] I am jumping in late so I m

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 - > >

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:

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 >> > (curren

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 fol

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: $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:13 AM Subject: Re: [PHP] Read Last Lines of a Text File > Scott Miller wrote: > > >>* Thus wrote Scott Miller ([EMAIL PROTECTED

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 on

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

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 some

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 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 no

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

[PHP] Read Last Lines of a Text File

2004-06-16 Thread Scott Miller
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 look at this below and tell me where I went wrong?