From 6c50efe76b8802210718a896ca0ceee421d25487 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 14 Apr 2010 13:50:31 +0000 Subject: [PATCH] Add an x-ref to where the O_ constants are documented and move the SEEK_ constants after lseek(). --- Doc/library/os.rst | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 11d9607a7d5..0c2cab74a1e 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -643,6 +643,16 @@ as internal buffering of data. the file. Availability: Unix, Windows. +.. data:: SEEK_SET + SEEK_CUR + SEEK_END + + Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, + respectively. Availability: Windows, Unix. + + .. versionadded:: 2.5 + + .. function:: open(file, flags[, mode]) Open the file *file* and set various flags according to *flags* and possibly its @@ -652,7 +662,7 @@ as internal buffering of data. For a description of the flag and mode values, see the C run-time documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) are defined in - this module too (see below). + this module too (see :ref:`open-constants`). .. note:: @@ -725,6 +735,12 @@ as internal buffering of data. :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`~file.write` method. + +.. _open-constants: + +``open()`` flag constants +~~~~~~~~~~~~~~~~~~~~~~~~~ + The following constants are options for the *flags* parameter to the :func:`~os.open` function. They can be combined using the bitwise OR operator ``|``. Some of them are not available on all platforms. For descriptions of @@ -776,16 +792,6 @@ or `the MSDN `_ on Window the C library. -.. data:: SEEK_SET - SEEK_CUR - SEEK_END - - Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, - respectively. Availability: Windows, Unix. - - .. versionadded:: 2.5 - - .. _os-file-dir: Files and Directories