RE: [PHP] Writting to files.?

From: Date: Thu, 05 Jul 2001 18:54:21 +0000
Subject: RE: [PHP] Writting to files.?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-56358@lists.php.net to get a copy of this message
On Thu, 5 Jul 2001, Don Read wrote: > > Anyone know how I can write and read to different lines in a file rather > > than just adding to the text already on the first line of the file? > > A. suck the whole thing up in memory, change it there, write it back out. Just as a note: for large (text or binary) files, it's better to use a temporary file (see tmpfile()) and limit the in-memory buffer to smth like 1024. After finishing, do not close the tmpfile (this would automatically delete it), but lseek and copy back to the original. Anyone know any better ways to deal with large file contents? thx, georgeb

« previous php.general (#56358) next »