From: Sean DiZazzo on
On Feb 19, 10:06 am, MRAB <pyt...(a)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.

~Sean
From: MRAB on
Sean DiZazzo wrote:
> On Feb 19, 10:06 am, MRAB <pyt...(a)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.