Re: not writing to file
- From: "Herbert Rosenau" <os2guy@xxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 10:29:20 +0000 (UTC)
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!
.
- References:
- not writing to file
- From: John Smith
- not writing to file
- Prev by Date: Re: finding how much the file system is full, from a C program?
- Next by Date: Re: I have a problem in my study
- Previous by thread: Re: not writing to file
- Next by thread: how to design an testing example
- Index(es):