Question about getmtime

MRAB python at mrabarnett.plus.com
Sat Feb 20 00:18:14 CET 2010


Sean DiZazzo wrote:
> On Feb 19, 10:06 am, MRAB <pyt... at mrabarnett.plus.com> wrote:
>> Brandon wrote:
>>> Hi everyone,
>>> Does copying or moving a file affect the return value of
>>> os.path.getmtime(path)?
>> The modification time of a copied file should be the same as the
>> original.
>>
>> The creation time of a copied file will be the time at which it was
>> copied, so that can result in the paradoxical state of a file having
>> been modified _before_ it was created! :-)
> 
> ctime does not stand for creation time.  I went through this a couple
> of months ago.  It's updated whenever the inode is updated, so
> changing permissions, among other things will update it.
> 
> It blew me away when I finally found this out.
> 
On Windows ctime doesn't change when the file permissions are changed.



More information about the Python-list mailing list