[Tutor] Simultaneous read and write on file

eryk sun eryksun at gmail.com
Tue Jan 19 01:10:27 EST 2016


On Mon, Jan 18, 2016 at 10:04 PM, Martin A. Brown <martin at linux-ip.net> wrote:
> The above is a very handy chart.  Did you find this somewhere, eryk
> sun, or is this from your own knowledge and experience?

The mapping to POSIX open flags is from a table in the POSIX fopen
spec [1] as well as the Windows CRT docs for fopen (see the equivalent
oflag table) [2]. The flags for "x" mode can be verified in the Python
3 source [3]. The "x" mode flags are also mentioned in GNU's libc docs
for fopen [4] and open-time flags [5].

The mapping from POSIX open flags to Windows create disposition and
access modes is from the CRT source for the _open function. I can't
provide a source link, but the source code is distributed with MSVC.
For VS2015 it's in lowio/open.cpp, decode_access_flags() and
decode_open_create_flags().

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html
[2]: https://msdn.microsoft.com/en-us/library/yeby3zcb
[3]: https://hg.python.org/cpython/file/v3.5.1/Modules/_io/fileio.c#l302
[4]: https://www.gnu.org/software/libc/manual/html_node/Opening-Streams.html
[5]: https://www.gnu.org/software/libc/manual/html_node/Open_002dtime-Flags.html


More information about the Tutor mailing list