Patch #658927: Add getctime to os.path.

Document that getatime and getmtime may return floats.
This commit is contained in:
Martin v. Löwis 2002-12-31 13:11:54 +00:00
parent 24a880b499
commit 96a60e4af5
6 changed files with 30 additions and 6 deletions

View file

@ -15,7 +15,7 @@ import stat
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","islink","exists","isdir","isfile","ismount",
"getatime","getctime","islink","exists","isdir","isfile","ismount",
"walk","expanduser","expandvars","normpath","abspath",
"samefile","sameopenfile","samestat","supports_unicode_filenames"]
@ -137,6 +137,9 @@ def getatime(filename):
"""Return the last access time of a file, reported by os.stat()."""
return os.stat(filename).st_atime
def getctime(filename):
"""Return the creation time of a file, reported by os.stat()."""
return os.stat(filename).st_ctime
# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.