fwrite(): can this function append to the middle of a file?

fwrite(): can this function append to the middle of a file?

am 16.08.2007 08:25:13 von joefazee

Can i write to the middle of a file using the fwrite() function like

-------------------
line one
line two
line three
--------------------
and maybe the next day i want to write in between line two and line three.
how pls.
--
View this message in context: http://www.nabble.com/fwrite%28%29%3A-can-this-function-appe nd-to-the-middle-of-a-file--tf4277768.html#a12175989
Sent from the Php - Database mailing list archive at Nabble.com.

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

Re: fwrite(): can this function append to the middle ofa file?

am 16.08.2007 08:46:48 von dmagick

joefazee wrote:
> Can i write to the middle of a file using the fwrite() function like
>
> -------------------
> line one
> line two
> line three
> --------------------
> and maybe the next day i want to write in between line two and line three.

Read in the whole file.

Put the line in the middle manually.

Write the whole file out again.

fwrite itself doesn't have the functionality you want.

--
Postgresql & php tutorials
http://www.designmagick.com/

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