summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-12-31 13:11:54 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-12-31 13:11:54 (GMT)
commit96a60e4af574d72f14ad70fc4db5986e1ad42aa5 (patch)
tree0e3b149954bb3f9df9257694f9a1e7d356e7ec7a /Lib/posixpath.py
parent24a880b499a53436de52ef9ef107db001e59e24b (diff)
downloadcpython-96a60e4af574d72f14ad70fc4db5986e1ad42aa5.zip
cpython-96a60e4af574d72f14ad70fc4db5986e1ad42aa5.tar.gz
cpython-96a60e4af574d72f14ad70fc4db5986e1ad42aa5.tar.bz2
Patch #658927: Add getctime to os.path.
Document that getatime and getmtime may return floats.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 4a92f18..8da9fda 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -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.