Connects f to the file descriptor d . A failure occurs when f is already connected to a file. Disconnects the attached file descriptor from f and returns the file descriptor. Before disconnection, flushes any waiting output to the file associated with the file descriptor. Opens file name and connects f to it.
Failure occurs if f is already open, or the call to f .
A seek to the end of file is performed. On some systems this is implemented in the operating system. In others it is implemented by seeking to the end of the file before each write. The file is opened for input. For fstreams it indicates that input operations should be allowed if possible.