Page 1 of 1

Saving a file after modifying it

Posted: Tue Mar 02, 2010 12:24 pm
by jateeq
Hello,

I've opened a file, made changes to it, and want to 'save' those changes. At the moment, I am opening the file in a textbox for the user to modify, and then when he/she clicks on 'save', whatever is in the textbox overwrites the original content of the file (i am opening the file with the 'w' option when i write to it). I suspect that this is inefficient, since if a user just adds one line at the end of a 1000 lined file, i'm wasting time writing useless strings to the file. Does anyone know of a way in which only the changes will be written to the original file, or is this way feasible enough?

Thank you,
Jawad.

Re: Saving a file after modifying it

Posted: Tue Mar 02, 2010 12:40 pm
by requinix
It's really not worth the effort. Stick with what you have.