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.
b, t
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Constant: b, t
Include: <stdio.h>
Context: fdopen, fopen, freopen
Synopsis: Specifies the mode of translation (b or t). The mode
is included in the string specifying the type of access
(r, w, a, r+, w+, a+).
The translation modes are described below:
Mode Meaning
t Opens in text (translated) mode. In this mode, carriage-
return──line-feed (CR-LF) combinations are translated
into single line feeds (LF) on input, and LF 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 or 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.
NOTE: The t option is not part of the ANSI standard for
open, but is a Microsoft extension and should not
be used where ANSI portability is desired.
b Opens in binary (untranslated) mode. The above
translations are suppressed.
If t or b is not given in type, the translation mode is defined by
the default-mode variable.
See: ◄BINMODE.OBJ► for a discussion of binary and text modes.