]> granicus.if.org Git - python/commitdiff
note how os.utime should be used for emulating touch
authorBenjamin Peterson <benjamin@python.org>
Sat, 16 Aug 2008 03:13:07 +0000 (03:13 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 16 Aug 2008 03:13:07 +0000 (03:13 +0000)
Doc/library/os.rst

index dab29348a8465d931750989027b1ae6be8eccee2..22b9a79e2dd3bc9b5933da59c088786a35923da3 100644 (file)
@@ -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*.