Overwriting a files contents:
Posted on 2002-06-18
I have a file which I lock and open, and i have set the open for input and output, assuming that since I didn't set it as append when I print to the file it would overwrite the current contents, sadly this is not the case...
So, what I need to do is open the file, read the contents into an array and then print a new set of contents over the top of what was there... is there a way I can do this without closing the file again the opening it as write only and printing, as I do not want to lose my lock on the file!
The script that is running is highly likely have multiple instances occuring and I cannot risk these instances getting data at inapropriate times...
Hope you can help