| description | Learn more about: _fmode | ||
|---|---|---|---|
| title | _fmode | ||
| ms.date | 11/04/2016 | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | ac6df9eb-e5cc-4c54-aff3-373c21983118 |
The _fmode variable sets the default file-translation mode for text or binary translation. This global variable has been deprecated for the more secure functional versions _get_fmode and _set_fmode, which should be used in place of the global variable. It's declared in Stdlib.h as follows.
extern int _fmode;The default setting of _fmode is _O_TEXT for text-mode translation. _O_BINARY is the setting for binary mode.
You can change the value of _fmode in three ways:
-
Link with Binmode.obj. This object file changes the initial setting of
_fmodeto_O_BINARY, causing all files exceptstdin,stdout, andstderrto be opened in binary mode. -
Make a call to
_get_fmodeor_set_fmodeto get or set the_fmodeglobal variable, respectively. -
Change the value of
_fmodedirectly by setting it in your program.