Re: Writing to files

From: Date: Fri, 11 Jul 2003 19:04:12 +0000
Subject: Re: Writing to files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-154922@lists.php.net to get a copy of this message
Hello, This is a reply to an e-mail that you wrote on Fri, 11 Jul 2003 at 19:56, lines prefixed by '>' were originally written by you. > Is there a way to write to a beginning of a file without it > overwriting > data that's already there or do I have to write to the end of the file > in order to preserve data? I ask because it would be much easier to > print the lines of the file out in order of last added first if I > could > add lines at the top of the file. Not without reading the entire file into a variable first then appending that variable to the data you wish to add and saving the entire file again (which will obviously take longer than appending to the end of the file). David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP)

« previous php.general (#154922) next »