Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libos.tex @ 25806:0bbea4dcd9be legacy-trunk
Add PyStructSequence_UnnamedField. Add stat_float_times.
Use integers in stat tuple, optionally floats in named fields.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Wed, 16 Oct 2002 18:27:39 +0000 |
| parents | 1a9f47885260 |
| children | f62f773bc9fd |
line wrap: on
line diff
--- a/Doc/lib/libos.tex Wed Oct 16 17:51:38 2002 +0000 +++ b/Doc/lib/libos.tex Wed Oct 16 18:27:39 2002 +0000 @@ -854,9 +854,10 @@ \member{st_ctime} (time of most recent content modification or metadata change). -\versionchanged [The time values are floats, measuring - seconds. Fractions of a second may be reported if the system - supports that]{2.3} +\versionchanged [If \function{stat_float_times} returns true, the time +values are floats, measuring seconds. Fractions of a second may be +reported if the system supports that. On Mac OS, the times are always +floats. See \function{stat_float_times} for further discussion. ]{2.3} On some Unix systems (such as Linux), the following attributes may also be available: @@ -899,6 +900,32 @@ [Added access to values as attributes of the returned object]{2.2} \end{funcdesc} +\begin{funcdesc}{stat_float_times}{\optional{newvalue}} +Determine whether \class{stat_result} represents time stamps as float +objects. If newval is True, future calls to stat() return floats, if +it is False, future calls return ints. If newval is omitted, return +the current setting. + +For compatibility with older Python versions, accessing +\class{stat_result} as a tuple always returns integers. For +compatibility with Python 2.2, accessing the time stamps by field name +also returns integers. Applications that want to determine the +fractions of a second in a time stamp can use this function to have +time stamps represented as floats. Whether they will actually observe +non-zero fractions depends on the system. + +Future Python releases will change the default of this settings; +applications that cannot deal with floating point time stamps can then +use this function to turn the feature off. + +It is recommended that this setting is only changed at program startup +time in the \var{__main__} module; libraries should never change this +setting. If an application uses a library that works incorrectly if +floating point time stamps are processed, this application should turn +the feature off until the library has been corrected. + +\end{funcdesc} + \begin{funcdesc}{statvfs}{path} Perform a \cfunction{statvfs()} system call on the given path. The return value is an object whose attributes describe the filesystem on
