The freopen() function first attempts to flush the stream and close any file descriptor associated with stream. Failure to flush or close the file successfully
is ignored. The error and end-of-file indicators for the stream are cleared.
The freopen() function opens the file whose pathname is the string pointed to by filename and associates the stream pointed to by stream
with it. The mode argument is used just as in fopen(3C).
The original stream is closed regardless of whether the subsequent open succeeds.
After a successful call to the freopen() function, the orientation of the stream is cleared and the associated mbstate_t object is set to describe an initial
conversion state.
The largest value that can be represented correctly in an object of type off_t will be established as the offset maximum in the open file description.
|