mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #658927: Add getctime to os.path.
Document that getatime and getmtime may return floats.
This commit is contained in:
parent
24a880b499
commit
96a60e4af5
6 changed files with 30 additions and 6 deletions
|
@ -5,7 +5,7 @@ from stat import *
|
|||
|
||||
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
|
||||
"basename","dirname","commonprefix","getsize","getmtime",
|
||||
"getatime","islink","exists","isdir","isfile",
|
||||
"getatime","getctime", "islink","exists","isdir","isfile",
|
||||
"walk","expanduser","expandvars","normpath","abspath",
|
||||
"supports_unicode_filenames"]
|
||||
|
||||
|
@ -129,6 +129,9 @@ def isfile(s):
|
|||
return False
|
||||
return S_ISREG(st.st_mode)
|
||||
|
||||
def getctime(filename):
|
||||
"""Return the creation time of a file, reported by os.stat()."""
|
||||
return os.stat(filename).st_ctime
|
||||
|
||||
def exists(s):
|
||||
"""Return True if the pathname refers to an existing file or directory."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue