diff options
author | Christian Heimes <christian@cheimes.de> | 2013-06-22 19:05:02 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-06-22 19:05:02 (GMT) |
commit | c77d9f38c2e1435c2d20af353abbb624f2767ba6 (patch) | |
tree | 5ab3e9d1bc2d9cf07263e404992d5def15d56c3b /Doc | |
parent | 6ce8d17d02bf1e39265d6c77fe5a851cb38cefd6 (diff) | |
download | cpython-c77d9f38c2e1435c2d20af353abbb624f2767ba6.zip cpython-c77d9f38c2e1435c2d20af353abbb624f2767ba6.tar.gz cpython-c77d9f38c2e1435c2d20af353abbb624f2767ba6.tar.bz2 |
Issue #11016: Add C implementation of the stat module as _stat
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/stat.rst | 51 | ||||
-rw-r--r-- | Doc/whatsnew/3.4.rst | 7 |
2 files changed, 56 insertions, 2 deletions
diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst index 02513df..a021fe2 100644 --- a/Doc/library/stat.rst +++ b/Doc/library/stat.rst @@ -6,7 +6,8 @@ os.lstat() and os.fstat(). .. sectionauthor:: Skip Montanaro <skip@automatrix.com> -**Source code:** :source:`Lib/stat.py` +**Source code:** :source:`Modules/_stat.c` + :source:`Lib/stat.py` -------------- @@ -15,6 +16,9 @@ results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they exist). For complete details about the :c:func:`stat`, :c:func:`fstat` and :c:func:`lstat` calls, consult the documentation for your system. +.. versionchanged:: 3.4 + The stat module is backed by a C implementation. + The :mod:`stat` module defines the following functions to test for specific file types: @@ -53,6 +57,24 @@ types: Return non-zero if the mode is from a socket. +.. function:: S_ISDOOR(mode) + + Return non-zero if the mode is from a door. + + .. versionadded:: 3.4 + +.. function:: S_ISPORT(mode) + + Return non-zero if the mode is from an event port. + + .. versionadded:: 3.4 + +.. function:: S_ISWHT(mode) + + Return non-zero if the mode is from a whiteout. + + .. versionadded:: 3.4 + Two additional functions are defined for more general manipulation of the file's mode: @@ -113,6 +135,10 @@ readable string: .. versionadded:: 3.3 + .. versionchanged:: 3.4 + The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and + :data:`S_IFWHT`. + All the variables below are simply symbolic indexes into the 10-tuple returned by :func:`os.stat`, :func:`os.fstat` or :func:`os.lstat`. @@ -210,6 +236,29 @@ Use of the functions above is more portable than use of the first set of flags: FIFO. +.. data:: S_IFDOOR + + Door. + + .. versionadded:: 3.4 + +.. data:: S_IFPORT + + Event port. + + .. versionadded:: 3.4 + +.. data:: S_IFWHT + + Whiteout. + + .. versionadded:: 3.4 + +.. note:: + + :data:`S_IFDOOR`, :data:`S_IFPORT` or :data:`S_IFWHT` are defined as + 0 when the platform does not have support for the file types. + The following flags can also be used in the *mode* argument of :func:`os.chmod`: .. data:: S_ISUID diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 16b03b3..b003c4e 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -182,7 +182,6 @@ functools New :func:`functools.singledispatch` decorator: see the :pep:`443`. - smtplib ------- @@ -213,6 +212,12 @@ wave The :meth:`~wave.getparams` method now returns a namedtuple rather than a plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.) +stat +--- + +The stat module is now backed by a C implementation in :mod:`_stat`. A C +implementation is required as most of the values aren't standardized and +platform-dependent. (Contributed by Christian Heimes in :issue:`11016`.) Optimizations ============= |