diff options
Diffstat (limited to 'Doc/library/os.path.rst')
-rw-r--r-- | Doc/library/os.path.rst | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index 32c48eb..dd3ac85 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -77,11 +77,16 @@ the :mod:`glob` module.) .. function:: exists(path) - Return ``True`` if *path* refers to an existing path. Returns ``False`` for - broken symbolic links. On some platforms, this function may return ``False`` if - permission is not granted to execute :func:`os.stat` on the requested file, even + Return ``True`` if *path* refers to an existing path or an open + file descriptor. Returns ``False`` for broken symbolic links. On + some platforms, this function may return ``False`` if permission is + not granted to execute :func:`os.stat` on the requested file, even if the *path* physically exists. + .. versionchanged:: 3.3 + *path* can now be an integer: ``True`` is returned if it is an + open file descriptor, ``False`` otherwise. + .. function:: lexists(path) @@ -126,7 +131,7 @@ the :mod:`glob` module.) Return the time of last access of *path*. The return value is a number giving the number of seconds since the epoch (see the :mod:`time` module). Raise - :exc:`os.error` if the file does not exist or is inaccessible. + :exc:`OSError` if the file does not exist or is inaccessible. If :func:`os.stat_float_times` returns True, the result is a floating point number. @@ -136,7 +141,7 @@ the :mod:`glob` module.) Return the time of last modification of *path*. The return value is a number giving the number of seconds since the epoch (see the :mod:`time` module). - Raise :exc:`os.error` if the file does not exist or is inaccessible. + Raise :exc:`OSError` if the file does not exist or is inaccessible. If :func:`os.stat_float_times` returns True, the result is a floating point number. @@ -147,13 +152,13 @@ the :mod:`glob` module.) Return the system's ctime which, on some systems (like Unix) is the time of the last change, and, on others (like Windows), is the creation time for *path*. The return value is a number giving the number of seconds since the epoch (see - the :mod:`time` module). Raise :exc:`os.error` if the file does not exist or + the :mod:`time` module). Raise :exc:`OSError` if the file does not exist or is inaccessible. .. function:: getsize(path) - Return the size, in bytes, of *path*. Raise :exc:`os.error` if the file does + Return the size, in bytes, of *path*. Raise :exc:`OSError` if the file does not exist or is inaccessible. @@ -259,7 +264,8 @@ the :mod:`glob` module.) Availability: Unix, Windows. - .. versionchanged:: 3.2 Added Windows support. + .. versionchanged:: 3.2 + Added Windows support. .. function:: samestat(stat1, stat2) |