File Ovewrite impossibility

  • Thread starter Thread starter Ron M. Newman
  • Start date Start date
R

Ron M. Newman

Hi,

My app has a config file that's saved as binary.

Creating it works.
Reading it works.
Overwriting it simply doesn't work and doesn't even throw an exception.

This is what I use: It works for the initial creation but not for
overwriting!

stream = new FileStream("MyApp.configuration",
FileMode.Create,
FileAccess.Write);

Any ideas?

Thanks
Ron
 
Sorry: My Bad.

The pathname I gave had only a filename and the open file dialog changed the
default folder as I went along - throwing off the overwrite target to the
last folder i browsed. This made it look as if the file is not written even
though no exception is thrown. The truth is the file WAS written - just not
where I expected it to be!

Ron
 
Hello, Ron!

After constructing file stream, did you write to that stream? What happens
to the file?
Is it truncated or appended?

You wrote on Thu, 12 Oct 2006 17:55:50 -0400:

RMN> Hi,

RMN> My app has a config file that's saved as binary.

RMN> Creating it works.
RMN> Reading it works.
RMN> Overwriting it simply doesn't work and doesn't even throw an
RMN> exception.

RMN> This is what I use: It works for the initial creation but not for
RMN> overwriting!

RMN> stream = new FileStream("MyApp.configuration",
RMN> FileMode.Create,
RMN> FileAccess.Write);

RMN> Any ideas?

RMN> Thanks
RMN> Ron
 
Back
Top