Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Side by Side Diff: Doc/library/os.rst

Issue 21719: Returning Windows file attribute information via os.stat()
Patch Set: Created 5 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Doc/library/stat.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`os` --- Miscellaneous operating system interfaces 1 :mod:`os` --- Miscellaneous operating system interfaces
2 ======================================================= 2 =======================================================
3 3
4 .. module:: os 4 .. module:: os
5 :synopsis: Miscellaneous operating system interfaces. 5 :synopsis: Miscellaneous operating system interfaces.
6 6
7 7
8 This module provides a portable way of using operating system dependent 8 This module provides a portable way of using operating system dependent
9 functionality. If you just want to read or write a file see :func:`open`, if 9 functionality. If you just want to read or write a file see :func:`open`, if
10 you want to manipulate paths, see the :mod:`os.path` module, and if you want to 10 you want to manipulate paths, see the :mod:`os.path` module, and if you want to
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 available (but may be only filled out if root tries to use them): 1895 available (but may be only filled out if root tries to use them):
1896 1896
1897 * :attr:`st_gen` - file generation number 1897 * :attr:`st_gen` - file generation number
1898 * :attr:`st_birthtime` - time of file creation 1898 * :attr:`st_birthtime` - time of file creation
1899 1899
1900 On Mac OS systems, the following attributes may also be available: 1900 On Mac OS systems, the following attributes may also be available:
1901 1901
1902 * :attr:`st_rsize` 1902 * :attr:`st_rsize`
1903 * :attr:`st_creator` 1903 * :attr:`st_creator`
1904 * :attr:`st_type` 1904 * :attr:`st_type`
1905
1906 On Windows systems, the following attribute is also available:
1907
1908 * :attr:`st_file_attributes` - Windows file attribute bits (see the
1909 ``FILE_ATTRIBUTE_*`` constants in the :mod:`stat` module)
1905 1910
1906 .. note:: 1911 .. note::
1907 1912
1908 The exact meaning and resolution of the :attr:`st_atime`, 1913 The exact meaning and resolution of the :attr:`st_atime`,
1909 :attr:`st_mtime`, and :attr:`st_ctime` attributes depend on the operating 1914 :attr:`st_mtime`, and :attr:`st_ctime` attributes depend on the operating
1910 system and the file system. For example, on Windows systems using the FAT 1915 system and the file system. For example, on Windows systems using the FAT
1911 or FAT32 file systems, :attr:`st_mtime` has 2-second resolution, and 1916 or FAT32 file systems, :attr:`st_mtime` has 2-second resolution, and
1912 :attr:`st_atime` has only 1-day resolution. See your operating system 1917 :attr:`st_atime` has only 1-day resolution. See your operating system
1913 documentation for details. 1918 documentation for details.
1914 Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, 1919 Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 >>> statinfo.st_size 1953 >>> statinfo.st_size
1949 264 1954 264
1950 1955
1951 Availability: Unix, Windows. 1956 Availability: Unix, Windows.
1952 1957
1953 .. versionadded:: 3.3 1958 .. versionadded:: 3.3
1954 Added the *dir_fd* and *follow_symlinks* arguments, 1959 Added the *dir_fd* and *follow_symlinks* arguments,
1955 specifying a file descriptor instead of a path, 1960 specifying a file descriptor instead of a path,
1956 and the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, 1961 and the :attr:`st_atime_ns`, :attr:`st_mtime_ns`,
1957 and :attr:`st_ctime_ns` members. 1962 and :attr:`st_ctime_ns` members.
1963
1964 .. versionadded:: 3.5
1965 Added the :attr:`st_file_attributes` member on Windows.
1958 1966
1959 1967
1960 .. function:: stat_float_times([newvalue]) 1968 .. function:: stat_float_times([newvalue])
1961 1969
1962 Determine whether :class:`stat_result` represents time stamps as float object s. 1970 Determine whether :class:`stat_result` represents time stamps as float object s.
1963 If *newvalue* is ``True``, future calls to :func:`~os.stat` return floats, if it is 1971 If *newvalue* is ``True``, future calls to :func:`~os.stat` return floats, if it is
1964 ``False``, future calls return ints. If *newvalue* is omitted, return the 1972 ``False``, future calls return ints. If *newvalue* is omitted, return the
1965 current setting. 1973 current setting.
1966 1974
1967 For compatibility with older Python versions, accessing :class:`stat_result` as 1975 For compatibility with older Python versions, accessing :class:`stat_result` as
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
3428 3436
3429 This function returns random bytes from an OS-specific randomness source. Th e 3437 This function returns random bytes from an OS-specific randomness source. Th e
3430 returned data should be unpredictable enough for cryptographic applications, 3438 returned data should be unpredictable enough for cryptographic applications,
3431 though its exact quality depends on the OS implementation. On a Unix-like 3439 though its exact quality depends on the OS implementation. On a Unix-like
3432 system this will query ``/dev/urandom``, and on Windows it will use 3440 system this will query ``/dev/urandom``, and on Windows it will use
3433 ``CryptGenRandom()``. If a randomness source is not found, 3441 ``CryptGenRandom()``. If a randomness source is not found,
3434 :exc:`NotImplementedError` will be raised. 3442 :exc:`NotImplementedError` will be raised.
3435 3443
3436 For an easy-to-use interface to the random number generator 3444 For an easy-to-use interface to the random number generator
3437 provided by your platform, please see :class:`random.SystemRandom`. 3445 provided by your platform, please see :class:`random.SystemRandom`.
OLDNEW
« no previous file with comments | « no previous file | Doc/library/stat.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+