Anonymous avatar Anonymous committed a255087

Changed all references to stat module S_* constants to stat.S_*
since it is v. confusing that in module os these constants are from
the stat module rather than from os.
Also added a couple of cross-references to open().

Comments (0)

Files changed (1)

Doc-26/library/os.rst

 
 This module provides a more portable way of using operating system dependent
 functionality than importing a operating system dependent built-in module like
-:mod:`posix` or :mod:`nt`.
+:mod:`posix` or :mod:`nt`. (If you just want to read or write a file see
+:func:`open`.)
 
 This module searches for an operating system dependent built-in module like
 :mod:`mac` or :mod:`posix` and exports the same functions and data as found
 File Object Creation
 --------------------
 
-These functions create new file objects.
+These functions create new file objects. (See also :func:`open`.)
 
 
 .. function:: fdopen(fd[, mode[, bufsize]])
    following values (as defined in the :mod:`stat` module) or bitwise or-ed
    combinations of them:
 
-* ``S_ISUID``
-
-* ``S_ISGID``
-
-* ``S_ENFMT``
-
-* ``S_ISVTX``
-
-* ``S_IREAD``
-
-* ``S_IWRITE``
-
-* ``S_IEXEC``
-
-* ``S_IRWXU``
-
-* ``S_IRUSR``
-
-* ``S_IWUSR``
-
-* ``S_IXUSR``
-
-* ``S_IRWXG``
-
-* ``S_IRGRP``
-
-* ``S_IWGRP``
-
-* ``S_IXGRP``
-
-* ``S_IRWXO``
-
-* ``S_IROTH``
-
-* ``S_IWOTH``
-
-* ``S_IXOTH``
+* ``stat.S_ISUID``
+
+* ``stat.S_ISGID``
+
+* ``stat.S_ENFMT``
+
+* ``stat.S_ISVTX``
+
+* ``stat.S_IREAD``
+
+* ``stat.S_IWRITE``
+
+* ``stat.S_IEXEC``
+
+* ``stat.S_IRWXU``
+
+* ``stat.S_IRUSR``
+
+* ``stat.S_IWUSR``
+
+* ``stat.S_IXUSR``
+
+* ``stat.S_IRWXG``
+
+* ``stat.S_IRGRP``
+
+* ``stat.S_IWGRP``
+
+* ``stat.S_IXGRP``
+
+* ``stat.S_IRWXO``
+
+* ``stat.S_IROTH``
+
+* ``stat.S_IWOTH``
+
+* ``stat.S_IXOTH``
 
    Availability: Macintosh, Unix, Windows.
 
    .. note::
 
       Although Windows supports :func:`chmod`, you can only  set the file's read-only
-      flag with it (via the ``S_IWRITE``  and ``S_IREAD`` constants or a corresponding
-      integer value).  All other bits are ignored.
+      flag with it (via the ``stat.S_IWRITE``  and ``stat.S_IREAD``
+      constants or a corresponding integer value).  All other bits are
+      ignored.
 
 
 .. function:: chown(path, uid, gid)
 
    Create a filesystem node (file, device special file or named pipe) named
    *filename*. *mode* specifies both the permissions to use and the type of node to
-   be created, being combined (bitwise OR) with one of S_IFREG, S_IFCHR, S_IFBLK,
-   and S_IFIFO (those constants are available in :mod:`stat`). For S_IFCHR and
-   S_IFBLK, *device* defines the newly created device special file (probably using
+   be created, being combined (bitwise OR) with one of ``stat.S_IFREG``,
+   ``stat.S_IFCHR``, ``stat.S_IFBLK``,
+   and ``stat.S_IFIFO`` (those constants are available in :mod:`stat`).
+   For ``stat.S_IFCHR`` and
+   ``stat.S_IFBLK``, *device* defines the newly created device special file (probably using
    :func:`os.makedev`), otherwise it is ignored.
 
    .. versionadded:: 2.3
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.