SYNOPSIS
#include <stdio.h>
FILE *fdopen(int fildes, const char *type);
DESCRIPTION
The
The type specified the stream must be allowed by the file access mode of the open file. The file position indicator associated with the new stream is set to the position indicated by the file offset associated with the file descriptor. The error indicator and end-of-file indicator for the stream are cleared.
When a file is opened for update, both input and output may be done on
the resulting stream.
However, output may not be directly followed by input without an
intervening
When a file is opened for append, you cannot overwrite information already
in the file.
You can use
When a stream is opened, it is fully buffered only if it does not refer to an interactive device.
PARAMETERS
- fildes
-
Indicates the file descriptor to map to a file pointer.
- type
-
Indicates a character string that specifies the desired type of file access. The first character of this string must be one of r (open for reading), w (open for writing), or a (open for writing at the end of file —append). After the first character, you can also add the + modifier that means to open for update, both reading and writing. The meaning of these flags is exactly as specified for
fopen() , except that w and w+ do not cause truncation of the file.
RETURN VALUES
If successful,
- EBADF
-
The fildes argument is not a valid file descriptor.
- EINVAL
-
The value of the type argument is invalid.
- EMFILE
-
Too many file descriptors are open in the calling process.
- ENOMEM
-
Insufficient storage space is available.
CONFORMANCE
POSIX.1 (1996).
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.5 Documentation Build 40.