C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
File-Mode Constants
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
  Constant:  _O_TEXT, _O_BINARY, _O_RAW
 
  Include:   <fcntl.h>
 
  Context:   _open, _sopen (<oflag> argument)
             _setmode (<mode> argument)
 
  Summary:   The _O_BINARY and _O_TEXT manifest constants determine
             the translation mode for files (_open and _sopen) or the
             translation mode for streams (_setmode).
 
     The allowed values are shown below:
 
     Constant      Meaning
 
     _O_TEXT       Sets text (translated) mode. Carriage-return─
                   linefeed combinations (CR-LF) are translated into a
                   single linefeed (LF) on input. Linefeed characters
                   are translated into CR-LF combinations on output.
                   Also, CTRL+Z is interpreted as an end-of-file
                   character on input. In files opened for reading and
                   reading/writing, fopen checks for CTRL+Z at the end
                   of the file and removes it, if possible. This is
                   done because using the fseek and ftell functions to
                   move within a file ending with CTRL+Z may cause
                   fseek to behave improperly near the end of the
                   file.
 
     _O_BINARY     Sets binary (untranslated) mode. The above
                   translations are suppressed.
 
     _O_RAW        Same as _O_BINARY. Supported for C 2.0 compatibility.
                                    -♦-