Associates a stream with a file descriptor that represents an open file or device.
#include <stdio.h> FILE *fdopen ( int fildes, const char *mode);
(IN) Specifies a file descriptor.
(IN) Points to a string specifying the file open mode. See Standard File Open Modes.
If successful, returns a pointer to the object controlling the stream. This pointer must be passed as a parameter to subsequent functions for performing operations on the file.
If the open operation fails, fdopen returns a NULL pointer and sets errno to one of the following:
The fdopen function associates a stream with a file descriptor, which represents an opened file or device. The fildes parameter is returned by a creat or open function. The mode parameter must match the mode with which the file or device was originally opened.
If mode does not match the flags used in opening the file originally, errno will be set to EINVAL and fdopen will fail. For a list of flags used by the oflag argument, see File Control Open Modes.