mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
note how os.utime should be used for emulating touch
This commit is contained in:
parent
4eb993939d
commit
5b02ef3e1b
1 changed files with 10 additions and 9 deletions
|
@ -1303,15 +1303,16 @@ Files and Directories
|
||||||
|
|
||||||
.. function:: utime(path, times)
|
.. function:: utime(path, times)
|
||||||
|
|
||||||
Set the access and modified times of the file specified by *path*. If *times* is
|
Set the access and modified times of the file specified by *path*. If *times*
|
||||||
``None``, then the file's access and modified times are set to the current time.
|
is ``None``, then the file's access and modified times are set to the current
|
||||||
Otherwise, *times* must be a 2-tuple of numbers, of the form ``(atime, mtime)``
|
time. (The effect is similar to running the Unix program :program:`touch` on
|
||||||
which is used to set the access and modified times, respectively. Whether a
|
the path.) Otherwise, *times* must be a 2-tuple of numbers, of the form
|
||||||
directory can be given for *path* depends on whether the operating system
|
``(atime, mtime)`` which is used to set the access and modified times,
|
||||||
implements directories as files (for example, Windows does not). Note that the
|
respectively. Whether a directory can be given for *path* depends on whether
|
||||||
exact times you set here may not be returned by a subsequent :func:`stat` call,
|
the operating system implements directories as files (for example, Windows
|
||||||
depending on the resolution with which your operating system records access and
|
does not). Note that the exact times you set here may not be returned by a
|
||||||
modification times; see :func:`stat`.
|
subsequent :func:`stat` call, depending on the resolution with which your
|
||||||
|
operating system records access and modification times; see :func:`stat`.
|
||||||
|
|
||||||
.. versionchanged:: 2.0
|
.. versionchanged:: 2.0
|
||||||
Added support for ``None`` for *times*.
|
Added support for ``None`` for *times*.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue