Re: Append to the beginning of a file...
| From: | Miguel Cruz | Date: | Thu, 21 Mar 2002 18:51:07 +0000 |
| Subject: | Re: Append to the beginning of a file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89575@lists.php.net to get a copy of this message | ||
On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
> I could append but then I need to read the first 8 chars of the last line I
> appended... neither something I know how to do.
Seek to the end of the file minus typical record length, read,
look for the penultimate end-of-record delimiter (\n, probably) in there,
and you've found your final record. If you don't find a delimiter, read
some more and tack it onto the beginning of your string, then check again.
Repeat until batter contains no large lumps.
miguel