Mercurial > cpython-lru_cache-weakref
diff Lib/macpath.py @ 26946:acdb39b714b1 legacy-trunk
Patch #658927: Add getctime to os.path.
Document that getatime and getmtime may return floats.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 31 Dec 2002 13:11:54 +0000 |
| parents | 7babdaea7d19 |
| children | 94b9cf4274de |
line wrap: on
line diff
--- a/Lib/macpath.py Tue Dec 31 12:55:15 2002 +0000 +++ b/Lib/macpath.py Tue Dec 31 13:11:54 2002 +0000 @@ -5,7 +5,7 @@ __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 @@ 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."""
