![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYStandard C Library (libc, -lc) SYNOPSIS
FILE *
FILE *
DESCRIPTIONThe
Each stream maintains a current position and
size. Initially, the position and size are set to zero. Each write begins at
the current position and advances it the number of successfully written
bytes for
A stream's buffer always contains a null character at the end of the buffer that is not included in the current length. If a stream's current position is moved beyond the current length via a seek operation and a write is performed, the characters between the current length and the current position are filled with null characters before the write is performed. After a successful call to fclose(3) or fflush(3), the pointer referenced by bufp will contain the start of the memory buffer and the variable referenced by sizep will contain the smaller of the current position and the current buffer length. After a successful call to fflush(3), the pointer referenced by bufp and the variable referenced by sizep are only valid until the next write operation or a call to fclose(3). Once a stream is closed, the allocated buffer referenced by bufp should be released via a call to free(3) when it is no longer needed. IMPLEMENTATION NOTESInternally all I/O streams are effectively byte-oriented, so using
wide-oriented operations to write to a stream opened via
RETURN VALUESUpon successful completion,
ERRORSSEE ALSOfclose(3), fflush(3), fopen(3), free(3), fseek(3), stdio(3), sbuf(9) STANDARDSThe
|