◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── The fopen function opens the file specified by <filename>. The character string <mode> specifies the type of access requested for the file. Because fopen assumes that the <mode> argument is a string literal, you must use quotation marks. For example: fopen( infile, "rtc" ); The valid types are "r" (read), "w" (write), and "a" (append). Any of these can be followed by a "+", which allows both read and write operations. The translation mode for new lines can be specified by adding "t" (text) or "b" (binary) to the <mode> string. In addition, you can use either "c" (commit) or "n" (no-commit) in the <mode> string. These two characters control whether the opened file is written directly to disk ("c") or to the operating system ("n") on an explicit call to either the fflush or the _flushall function. The fopen function defaults to "n". Explicit use of either "c" or "n" overrides the global commit flag. The global commit flag defaults to "n" unless you explicitly link your program with COMMODE.OBJ. The "t", "c", and "n" options are not part of the ANSI standard, but are instead Microsoft extensions and should not be used where ANSI portability is desired. See: ◄BINMODE.OBJ► ◄COMMODE.OBJ► See also the individual constants for access type and translation mode: ◄Access Types► ◄Commit-to-Disk Modes► ◄Translation Modes► Return Value The fopen function returns a pointer to the open file. A null pointer value indicates an error. -♦-