bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fputs(), fflush() and fclose() behaviour


From: EQU
Subject: fputs(), fflush() and fclose() behaviour
Date: Thu, 31 Oct 2002 10:48:33 +0200 (EET)

This might or might not be a bug report but me lacking
information. I'm sorry if it's the latter.

The buffered I/O function fputs() doesn't seem to check for write
success. Since a user program doesn't have control over the flushing
of data unless calling fflush() immediatly after fputs() (not 100%
accurate) it seems weird that checking for a successive write
operation at time of fputs() has no meaning. Take a scenario where I
call fputs() to store one KB of data. If the disk is full or the
user/group quota has been reached the fputs() will still succeed. If I
call fflush() or fclose() after fputs() I will get the proper
behaviour (the "write" will fail).

Would you please explain this behaviour to me? If I want to check for
write success I do that check at the time writing regardless whether
the I/O beneath is buffered or not, not at flushing time which I have
no explicit control over.

My observations are based on a user bug report (I am the programmer of
the IRC bot oer, http://oer.equnet.org), I haven't reproduced the
behaviour myself.

Thank you in advance.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]