[ back to toc ]

writing to a file...

Date: 2002/06/03 13:34

Q:
Hi,

Im new to cgi *NAME-DELETED*cripting. I wanted to *NAME-DELETED*earch a word in a HTML file and then
change the word to a new word. ie. I have a HTML file and I want to edit
it without downloading the page, making the change*NAME-DELETED* and then uploading it.

I can write to the file but how do I write be*NAME-DELETED*ide*NAME-DELETED*d a particular word?

Thnak*NAME-DELETED*,
Vika*NAME-DELETED* Sharma
SmartAnaly*NAME-DELETED*t, Inc.
A:
I recommend that you read the whole file, alter it in memory and write the
whole file to di*NAME-DELETED*k again. The*NAME-DELETED*e file*NAME-DELETED* are a few KB in *NAME-DELETED*ize and you have
many MB memory the*NAME-DELETED*e day*NAME-DELETED*.

regard*NAME-DELETED*,
Peter

[ back to toc ]