473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

File Ovewrite impossibility

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

Oct 12 '06 #1
3 1187
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

"Ron M. Newman" <co**********@confideltial.comwrote in message
news:ex**************@TK2MSFTNGP03.phx.gbl...
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

Oct 12 '06 #2
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:

RMNHi,

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

RMNCreating it works.
RMNReading it works.
RMNOverwriting it simply doesn't work and doesn't even throw an
RMNexception.

RMNThis is what I use: It works for the initial creation but not for
RMNoverwriting!

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

RMNAny ideas?

RMNThanks
RMN Ron


--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Oct 12 '06 #3
Hi: read previous message (FALSE ALARM)

Thanks,
Ron

"Vadym Stetsyak" <va*****@ukr.netwrote in message
news:uc**************@TK2MSFTNGP02.phx.gbl...
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:

RMNHi,

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

RMNCreating it works.
RMNReading it works.
RMNOverwriting it simply doesn't work and doesn't even throw an
RMNexception.

RMNThis is what I use: It works for the initial creation but not for
RMNoverwriting!

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

RMNAny ideas?

RMNThanks
RMN Ron


--
With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com

Oct 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
1
by: balzano_1 | last post by:
Hi, im trying to upload a file from a client (windows) to an ftp server (linux), i deciede to use some of php`s functions to connect and authenticate etc.. i only wish to put a file on the server,...
15
by: Simon | last post by:
I would like to create a very basic file upload add image form to add to my web site and to keep them in a "tmp" directory within my web hosting file manager once uploaded. I understand the basic...
1
by: Muttly | last post by:
Hey all. I'm trying to upload multiple files. I'm using the chm file from php.net to help me figure it out. I also checked online and say theres a problem with the file. Anyway My html looks like...
2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
7
by: Günther Steinmetz | last post by:
i think it is user friendly to have a default file in each subdirectory. However, i hate to have lots of index.html files. Instead i would like to have a meaningful and unique file name for all my...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.