Page 1 of 1

PHP fseek and fwrite help

Posted: Wed Aug 29, 2007 10:10 am
by IamTK
How do i use Fseek() without having fwrite() replace whatever's there before?

Like I want to seek the pointer to a certain spot, then use fwrite to write something there without replacing what's there already.

And how do I move the pointer down instead of just to the right? Fseek only moves the pointer to the right on the same line of code, I want to be able to move up and down rows, how can i do that?

Posted: Thu Aug 30, 2007 7:58 am
by feyd
You will have to read all data after it into a buffer which you add after your insertion.

Posted: Thu Aug 30, 2007 10:40 am
by IamTK
feyd wrote:You will have to read all data after it into a buffer which you add after your insertion.
How do I read the data into a buffer?

Posted: Thu Aug 30, 2007 11:46 am
by feyd
fread() may be a start.

Posted: Thu Aug 30, 2007 1:24 pm
by IamTK
feyd wrote:fread() may be a start.
ah i see.

Thank you very much for your help!