Borland C++ reference

_fmode

raw OCR global variable

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_BINARYare 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_BINARYor 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`