Re: question
- From: Kenneth Brody <kenbrody@xxxxxxxxxxx>
- Date: Tue, 15 Jan 2008 15:44:56 -0500
Serve Lau wrote:
"Keith Thompson" <kst-u@xxxxxxx> schreef in bericht
news:87fxx2s8al.fsf@xxxxxxxxxxxxxxxxxx
fclose(fp);}
No error checking (yes, fclose can fail).
Yes, I also changed the code layout. Whitespace is not in short
supply; use as much as you need to make the code clear and readable.
I'm wondering how to handle failure of fclose. Has anyone ever had it fail
and for what reasons?
Consider an output stream which is buffered, and the buffered data,
once written, will cause the file to grow, and the filesystem on which
the file resides is currently full.
You now call fclose() on that stream.
Without knowing how your implementation handles an fwrite()/fflush()
failure within fclose(), I can't say whether fclose() will fail, or
ignore the internal failure. However, it's certainly possible that
the fwrite()/fflush() failure will cause fclose() to fail.
Now, as to how to handle it? That's another issue entirely.
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>
.
- References:
- question
- From: Bill Cunningham
- Re: question
- From: Keith Thompson
- Re: question
- From: Serve Lau
- question
- Prev by Date: Re: question
- Next by Date: Re: Preprocessor directive
- Previous by thread: Re: question
- Next by thread: Re: question
- Index(es):
Relevant Pages
|