Re: not writing to file



On Tue, 31 Oct 2006 00:44:05 UTC, John Smith <jsmith@xxxxxxxxxxx>
wrote:

I try to write some data to a file. After some data had supposedly
been written to the file, I opened the file before the program
closed it and found it empty. What's wrong with my code? Thanks.

No, you've written something to the stream related to the file.
Without flushing the output stream no data is written to disk in your
sample.

You have to do excessive error checking to catch any possible error
(looks like you have not). Opening a file already open for write to
read it will fail on most systems.

You have NOT posted any relevant information we need to help you.
Rework your program to any possible error checking in it - and then,
when this will compile and run without any error come back.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
.