_fmode
Determines default file-translation mode.
Defined in header <fcntl.h>
Syntax
extern int _fmode;
Remarks
_fmode determines in which mode (text or binary) files vv^ill be opened and translated. The value of _fmode is O_TEXT by default, which specifies that
| files will be read in text mode. If _fmode is set to 0_B1NARY, | the files are |
| opened and read in binary mode. (O_TEXT and O_BINARY | are defined in |
fcntLh.)
In text mode, on input carriage-return/linefeed (CR/LF) combinations are translated to a single linefeed character (LF). On output, the reverse is true: LF characters are translated to CR/LF combinations.
In binary mode, no such translation occurs.
You can override the default mode as set by _fmode by specifying a t (for text mode) or h (for binary mode) in the argument type in the library routines fopen, fdopen, and freopen. Also, in the routine open, the
| argument access can include either O_BINARY | or O_TEXT, which will |
explicitly define the file being opened (given by the open pathname argument) to be in either binary or text mode.
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `fmode` read as `_fmode`
Stable link: /3.1/fcntl.h/_fmode/
· short form /3.1/_fmode/