On Sat, 26 Dec 1998, Glynn Clements wrote:

> > > Use "w+". That will create the file if it doesn't exist, and truncate
> > > it to zero length if it does exist.
> > 
> >   That's what I don't want ! I don't want it truncate file!
> >   If file doesn't exist just create it else open it for read/write without
> > truncate it!
> 
> Then use "a+", but your last message specifically said that you didn't 
> want to append.
> 
> In the event that the output file already exists, you have two
> options: you can either replace (truncate) the existing file, or
> append to it.

but he doesn't want to append to the file if it exists and he doesn't want
to replace the file if it exists... which is (in this universe)
impossible. This isn't a windows program is it? cos that sounds like some
weird thing that they'd try :)

unless he's trying to overwrite the file (or parts of it)... in which case
just open it in append mode and seek to the start (or whereever). but i
can't think of a good reason to do that.

Reply via email to