@@ -677,6 +677,16 @@ as internal buffering of data.
677677 Availability: Unix, Windows.
678678
679679
680+ .. data :: SEEK_SET
681+ SEEK_CUR
682+ SEEK_END
683+
684+ Parameters to the :func: `lseek ` function. Their values are 0, 1, and 2,
685+ respectively. Availability: Windows, Unix.
686+
687+ .. versionadded :: 2.5
688+
689+
680690.. function :: open(file, flags[, mode])
681691
682692 Open the file *file * and set various flags according to *flags * and possibly its
@@ -686,7 +696,8 @@ as internal buffering of data.
686696
687697 For a description of the flag and mode values, see the C run-time documentation;
688698 flag constants (like :const: `O_RDONLY ` and :const: `O_WRONLY `) are defined in
689- this module too (see below).
699+ this module too (see :ref: `open-constants `). In particular, on Windows adding
700+ :const: `O_BINARY ` is needed to open files in binary mode.
690701
691702 Availability: Unix, Windows.
692703
@@ -774,6 +785,12 @@ as internal buffering of data.
774785 :func: `fdopen `, or :data: `sys.stdout ` or :data: `sys.stderr `, use its
775786 :meth: `~file.write ` method.
776787
788+
789+ .. _open-constants :
790+
791+ ``open() `` flag constants
792+ ~~~~~~~~~~~~~~~~~~~~~~~~~
793+
777794The following constants are options for the *flags * parameter to the
778795:func: `~os.open ` function. They can be combined using the bitwise OR operator
779796``| ``. Some of them are not available on all platforms. For descriptions of
@@ -825,16 +842,6 @@ or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Window
825842 the C library.
826843
827844
828- .. data :: SEEK_SET
829- SEEK_CUR
830- SEEK_END
831-
832- Parameters to the :func: `lseek ` function. Their values are 0, 1, and 2,
833- respectively. Availability: Windows, Unix.
834-
835- .. versionadded :: 2.5
836-
837-
838845.. _os-file-dir :
839846
840847Files and Directories
0 commit comments