Use New Flags to Speed Up C Run-time Low-Level I/O Functions (131324)
The information in this article applies to:
- The C Run-Time (CRT), when used with:
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q131324 SUMMARY
The low-level file open functions in the C Run-time library for the 32-bit
Edition of Visual C++ accept some additional flags to allow you to take
advantage of Win32-specific file system features. These flags are not
available in the 16-bit version of Visual C++.
The low-level file open functions are: _open, _wopen, _sopen, and _wsopen.
The new flags (and others) can be combined together with the bitwise OR
operator and passed as the 'oflag' argument to the file open functions.
The file open functions call the Win32 function 'CreateFile' to actually
open the file with the specified options. The following table relates these
new C Run-time flags to the equivalent flags that are passed to CreateFile.
C Run-time Flag CreateFile Flag
_O_SHORT_LIVED FILE_ATTRIBUTE_TEMPORARY
_O_TEMPORARY FILE_FLAG_DELETE_ON_CLOSE
_O_RANDOM FILE_FLAG_RANDOM_ACCESS
_O_SEQUENTIAL FILE_FLAG_SEQUENTIAL_SCAN
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbCRT KB131324 |
---|
|