This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ctime is not creation time
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: johahn, loewis, rhettinger, siemer, sjoerd
Priority: normal Keywords:

Created on 2003-10-22 00:32 by siemer, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (10)
msg18714 - (view) Author: Robert Siemer (siemer) Date: 2003-10-22 00:32
Hi!

http://python.org/doc/current/lib/module-os.path.html
says getctime() returns the creation time. But it
probably returns the ctime, which has nothing to do
with creation.

Bye,
Robert
msg18715 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-22 16:02
Logged In: YES 
user_id=21627

Why do you say ctime has nothing to do with creation? What 
else does ctime indicate?
msg18716 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2003-10-22 21:14
Logged In: YES 
user_id=43607

ctime is change time.  Read the manual (stat(2)):
time_t        st_atime;    /* time of last access */
time_t        st_mtime;    /* time of last modification */
time_t        st_ctime;    /* time of last change */
msg18717 - (view) Author: Robert Siemer (siemer) Date: 2003-10-22 22:11
Logged In: YES 
user_id=150699

ctime is the time of last modification of file status
information.
Means: gets updated on everything... (-:
There is no way on classic Linux-Filesystems to get the
creation time.
msg18718 - (view) Author: Johan M. Hahn (johahn) Date: 2003-10-23 08:14
Logged In: YES 
user_id=887415

On Windows 2000 os.path.ctime (-> ntpath.getctime -> 
ntpath.stat.st_ctime) returns creation time.
msg18719 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-10-27 20:05
Logged In: YES 
user_id=80475

Fixed.
See Doc/lib/libposixpath.tex 1.37 and 1.36.12.1.
msg18720 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-27 23:57
Logged In: YES 
user_id=21627

So what about the issue that ctime really does mean
"creation time" on Windows?
msg18721 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-10-28 06:22
Logged In: YES 
user_id=80475

Hmm, it looks like there is more that one answer.

From Linux man pages:  ctime is the "inode change time"

From MSDN specs:  ctime "Indicates the creation time for
this storage, stream, or byte array". 

We can either document both or just put that getctime
returns the operating system's ctime field for open storage,
a stream, or a byte-array.
msg18722 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-10-28 20:26
Logged In: YES 
user_id=21627

I suggest to document all of these: it returns the system's
ctime, which, on some systems (e.g. Unix) is change time,
and, on others (e.g. Windows), is creation time.
msg18723 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-10-29 00:47
Logged In: YES 
user_id=80475

Done.
History
Date User Action Args
2022-04-11 14:56:00adminsetgithub: 39441
2003-10-22 00:32:05siemercreate