STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fcntl.h
Go to the documentation of this file.
1 //
2 // fcntl.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // File control options used by _open().
7 //
8 #pragma once
9 #define _INC_FCNTL
10 
11 
12 
13 #define _O_RDONLY 0x0000 // open for reading only
14 #define _O_WRONLY 0x0001 // open for writing only
15 #define _O_RDWR 0x0002 // open for reading and writing
16 #define _O_APPEND 0x0008 // writes done at eof
17 
18 #define _O_CREAT 0x0100 // create and open file
19 #define _O_TRUNC 0x0200 // open and truncate
20 #define _O_EXCL 0x0400 // open only if file doesn't already exist
21 
22 // O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s and <lf>
23 // sequences translated to <cr><lf> on write()'s
24 
25 #define _O_TEXT 0x4000 // file mode is text (translated)
26 #define _O_BINARY 0x8000 // file mode is binary (untranslated)
27 #define _O_WTEXT 0x10000 // file mode is UTF16 (translated)
28 #define _O_U16TEXT 0x20000 // file mode is UTF16 no BOM (translated)
29 #define _O_U8TEXT 0x40000 // file mode is UTF8 no BOM (translated)
30 
31 // macro to translate the C 2.0 name used to force binary mode for files
32 #define _O_RAW _O_BINARY
33 
34 #define _O_NOINHERIT 0x0080 // child process doesn't inherit file
35 #define _O_TEMPORARY 0x0040 // temporary file bit (file is deleted when last handle is closed)
36 #define _O_SHORT_LIVED 0x1000 // temporary storage file, try not to flush
37 #define _O_OBTAIN_DIR 0x2000 // get information about a directory
38 #define _O_SEQUENTIAL 0x0020 // file access is primarily sequential
39 #define _O_RANDOM 0x0010 // file access is primarily random
40 
41 
42 
43 #if (defined _CRT_DECLARE_NONSTDC_NAMES && _CRT_DECLARE_NONSTDC_NAMES) || (!defined _CRT_DECLARE_NONSTDC_NAMES && !__STDC__)
44  #define O_RDONLY _O_RDONLY
45  #define O_WRONLY _O_WRONLY
46  #define O_RDWR _O_RDWR
47  #define O_APPEND _O_APPEND
48  #define O_CREAT _O_CREAT
49  #define O_TRUNC _O_TRUNC
50  #define O_EXCL _O_EXCL
51  #define O_TEXT _O_TEXT
52  #define O_BINARY _O_BINARY
53  #define O_RAW _O_BINARY
54  #define O_TEMPORARY _O_TEMPORARY
55  #define O_NOINHERIT _O_NOINHERIT
56  #define O_SEQUENTIAL _O_SEQUENTIAL
57  #define O_RANDOM _O_RANDOM
58 #endif