diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-16 03:13:07 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-16 03:13:07 (GMT) |
commit | 5b02ef3e1b444372bda5b80d8646eb0afc00636d (patch) | |
tree | f05855e9ff9b2f072e9853f794e69371dd67565e | |
parent | 4eb993939dfe6c10a2e12f35ee7f1c250f222a8f (diff) | |
download | cpython-5b02ef3e1b444372bda5b80d8646eb0afc00636d.zip cpython-5b02ef3e1b444372bda5b80d8646eb0afc00636d.tar.gz cpython-5b02ef3e1b444372bda5b80d8646eb0afc00636d.tar.bz2 |
note how os.utime should be used for emulating touch
-rw-r--r-- | Doc/library/os.rst | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index dab2934..22b9a79 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1303,15 +1303,16 @@ Files and Directories .. function:: utime(path, times) - Set the access and modified times of the file specified by *path*. If *times* is - ``None``, then the file's access and modified times are set to the current time. - Otherwise, *times* must be a 2-tuple of numbers, of the form ``(atime, mtime)`` - which is used to set the access and modified times, respectively. Whether a - directory can be given for *path* depends on whether the operating system - implements directories as files (for example, Windows does not). Note that the - exact times you set here may not be returned by a subsequent :func:`stat` call, - depending on the resolution with which your operating system records access and - modification times; see :func:`stat`. + Set the access and modified times of the file specified by *path*. If *times* + is ``None``, then the file's access and modified times are set to the current + time. (The effect is similar to running the Unix program :program:`touch` on + the path.) Otherwise, *times* must be a 2-tuple of numbers, of the form + ``(atime, mtime)`` which is used to set the access and modified times, + respectively. Whether a directory can be given for *path* depends on whether + the operating system implements directories as files (for example, Windows + does not). Note that the exact times you set here may not be returned by a + subsequent :func:`stat` call, depending on the resolution with which your + operating system records access and modification times; see :func:`stat`. .. versionchanged:: 2.0 Added support for ``None`` for *times*. |