If you have a file that is to large to simply read into memory, do your
inserts and then write back out then you need to move it to a database.
Cluttering up the main code base with random flat-file reads and writes is
not necessary.

If you seriously need it then you can do as suggested, create a new file,
read from the old file, insert at the proper place, close, delete, rename,
rinse, repeat. If you think about it, that's what the php developers will
have to do to accommodate your request. (assuming again that your file is
too large to simply fit in memory.)

It may be a need for you but in my 2 years of using PHP, you are the first
person I've seen ask for it.  Therefore I don't think it qualifies as a
serious flaw.

IMHO, etc.
* Cal Evans
* The Virtual CIO
* http://www.calevans.com

-----Original Message-----
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 30, 2002 7:46 AM
Subject: [PHP] File Random Access

I never noticed before...there is no easy way to perform random-access read
and WRITE on a

I vote/recommend/suggest that this most basic functionality be added to the
next release
of PHP.  This would not be an enhancement; rather, it is correcting a
serious flaw.

Or am I missing something????

----- Original Message -----
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 6:28 AM
Subject: Re: [PHP] write on the begin of a file

There is no insert in fputs, you need to make a new file and then rename
it to
your old one, or build it in the memory and then overwrite it.

Sébastien Eckert -- Netika wrote:

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to