Reply to Re: Remove content in file

Your name:

Reply:


Posted by J.O. Aho on 09/30/80 11:39

Pete wrote:
> I'm having some log files from different php scripts on my website. I would
> like to make script that reduces the log files to 500 lines, etc., when I
> think they are growing too big. What is the best way to do this? The only
> way I know is to import the file into an array and write back the latest 500
> lines, but is there a better way?

You can check how many lines the file has, then loop through the files 500
last lines and write those lines to another file, when finished move the new
file over the old one.


//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация