Table of Contents

NAME

SYNOPSIS

DESCRIPTION

The function opens the file whose name is the string pointed to by and associates a stream with it. The argument points to a string beginning with one of the following sequences (Additional characters may follow these sequences.): Open text file for reading. The stream is positioned at the beginning of the file. Open for reading and writing. The stream is positioned at the beginning of the file. Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file. Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file. Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file. Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file. The string can also include the letter ‘‘b’’ either as a third character or as a character between the characters in any of the two-character strings described above. This is strictly for compatibility with and has no effect; the ‘‘b’’ is ignored. Any created files will have mode | | | | | as modified by the process’ umask value (see Reads and writes may be intermixed on read/write streams in any order, and do not require an intermediate seek as in previous versions of This is not portable to other systems, however; requires that a file positioning function intervene between output and input, unless an input operation encounters end-of-file. The function associates a stream with the existing file descriptor, The of the stream must be compatible with the mode of the file descriptor. The function opens the file whose name is the string pointed to by and associates the stream pointed to by with it. The original stream (if it exists) is closed. The argument is used just as in the function. The primary use of the function is to change the file associated with a standard text stream or

RETURN VALUES

Upon successful completion and return a pointer. Otherwise, is returned and the global variable is set to indicate the error.

ERRORS

The provided to or was invalid. The and functions may also fail and set for any of the errors specified for the routine The function may also fail and set for any of the errors specified for the routine The function may also fail and set for any of the errors specified for the routine The function may also fail and set for any of the errors specified for the routines and

SEE ALSO

STANDARDS

The and functions conform to The function conforms to


Table of Contents