On Friday 22 March 2002 00:40, Mauricio Sthandier wrote: > I already seen it... I used "r+" and "aw". > I saw and example in www.php.net, in the fopen function description, but it > is incomplete... > this is taking me hours !!!. > Well, if I can preappend... how can I read, for example, the first 8 chars > of the last line I inserted ?. They have no fixed length. > I'm starting to feel silly :(. > > "Chris Boget" <[EMAIL PROTECTED]> escribió en el mensaje > news:01bd01c1d0f6$3fc51f60$[EMAIL PROTECTED]... > > > > I guess thist must be really silly... but how can I append text to the > > > beginning of a file ??? > > > I've been trying since a while... but all I get is overwriting !. > > > > Check out fopen(). There is an argument that you can use in that > > function call to determine how the data is sent to the file.
Write your stuff to a new file, read old file, add stuff from old file onto new file, rename new file to old file OR read old file into a very long string add new stuff to beginning of very long string write very long string to old file -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Technological progress has merely provided us with more efficient means for going backwards. -- Aldous Huxley */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php