Share via


File Translation Constants (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Global Constants

These constants specify 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+").

#include <stdio.h>

Remarks

The translation modes are as follows:

  • t
    Opens in text (translated) mode.

    In this mode, carriage-return/linefeed (CR-LF) combinations are translated into single linefeeds (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 might cause fseek to behave improperly near the end of the file.

    Note   The t option is not part of the ANSI standard for fopen and freopen. It is a Microsoft extension and should not be used where ANSI portability is needed.

  • b
    Opens in binary (untranslated) mode. The above translations are suppressed.

If t or b is not given in mode, the translation mode is defined by the default-mode variable _fmode.

See Also

_fmode | fopen | freopen | fseek

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.