Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30383 > unrolled thread

what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'.

Started by陈伟 <chenwei.address@gmail.com>
First post2012-09-28 06:12 -0700
Last post2012-09-29 20:24 +0100
Articles 7 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. 陈伟 <chenwei.address@gmail.com> - 2012-09-28 06:12 -0700
    Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. Chris Angelico <rosuav@gmail.com> - 2012-09-29 01:07 +1000
    Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. Christian Heimes <christian@python.org> - 2012-09-28 17:18 +0200
    Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. Chris Angelico <rosuav@gmail.com> - 2012-09-29 01:25 +1000
    Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. Nobody <nobody@nowhere.com> - 2012-09-28 18:22 +0100
    Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. "Kristen J. Webb" <kwebb@teradactyl.com> - 2012-09-28 11:48 -0600
      Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'. Nobody <nobody@nowhere.com> - 2012-09-29 20:24 +0100

#30383 — what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'.

From陈伟 <chenwei.address@gmail.com>
Date2012-09-28 06:12 -0700
Subjectwhat is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change' and 'modification'.
Message-ID<e5a3b91c-0cbc-495d-b62f-ce16bb97db45@googlegroups.com>


[toc] | [next] | [standalone]


#30398

FromChris Angelico <rosuav@gmail.com>
Date2012-09-29 01:07 +1000
Message-ID<mailman.1558.1348844838.27098.python-list@python.org>
In reply to#30383
On Fri, Sep 28, 2012 at 11:12 PM, 陈伟 <chenwei.address@gmail.com> wrote:
>
> --
> http://mail.python.org/mailman/listinfo/python-list

In future, can you put the body of your message into the body please? :)

ctime is creation time, not change time. mtime is modification time,
as you have. But I can understand where the confusion comes from;
Google tells me there've been documentation bugs involving this very
thing (and Google, being extremely Lawful Neutral, would have happily
told you the same thing if you'd asked).

ChrisA

[toc] | [prev] | [next] | [standalone]


#30400

FromChristian Heimes <christian@python.org>
Date2012-09-28 17:18 +0200
Message-ID<mailman.1560.1348845523.27098.python-list@python.org>
In reply to#30383
Am 28.09.2012 17:07, schrieb Chris Angelico:
> On Fri, Sep 28, 2012 at 11:12 PM, 陈伟 <chenwei.address@gmail.com> wrote:
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
> 
> In future, can you put the body of your message into the body please? :)
> 
> ctime is creation time, not change time. mtime is modification time,
> as you have. But I can understand where the confusion comes from;
> Google tells me there've been documentation bugs involving this very
> thing (and Google, being extremely Lawful Neutral, would have happily
> told you the same thing if you'd asked).

In the future please read the manual before replying! ;) You are wrong,
ctime is *not* the creation time. It's the change time of the inode.
It's updated whenever the inode is modified, e.g. metadata modifications
like permission changes, link/unlink of hard links etc.

Christian





[toc] | [prev] | [next] | [standalone]


#30404

FromChris Angelico <rosuav@gmail.com>
Date2012-09-29 01:25 +1000
Message-ID<mailman.1563.1348845921.27098.python-list@python.org>
In reply to#30383
On Sat, Sep 29, 2012 at 1:18 AM, Christian Heimes <christian@python.org> wrote:
> Am 28.09.2012 17:07, schrieb Chris Angelico:
> In the future please read the manual before replying! ;) You are wrong,
> ctime is *not* the creation time. It's the change time of the inode.
> It's updated whenever the inode is modified, e.g. metadata modifications
> like permission changes, link/unlink of hard links etc.

Whoops, my bad! Sorry. I was remembering some other APIs with similar
terminology.

Lesson: Check the docs, they're more reliable.

ChrisA

[toc] | [prev] | [next] | [standalone]


#30417

FromNobody <nobody@nowhere.com>
Date2012-09-28 18:22 +0100
Message-ID<pan.2012.09.28.17.22.11.342000@nowhere.com>
In reply to#30383
On Fri, 28 Sep 2012 06:12:35 -0700, 陈伟 wrote:

> what is the difference between st_ctime and st_mtime one is the time of
> last change and the other is the time of last modification, but i can
> not understand what is the difference between 'change' and 'modification'. 

st_mtime is updated when the file's contents change. st_ctime is updated
when the file's metadata (owner, group, permissions, link count, etc)
changes.

[toc] | [prev] | [next] | [standalone]


#30419

From"Kristen J. Webb" <kwebb@teradactyl.com>
Date2012-09-28 11:48 -0600
Message-ID<mailman.1574.1348854907.27098.python-list@python.org>
In reply to#30383
The Windows stat() call treats things differently,

FROM: http://msdn.microsoft.com/en-us/library/14h5k7ff%28v=vs.80%29.aspx

  st_ctime

     Time of creation of file. Valid on NTFS but not on FAT formatted disk drives.

I don't think that Windows has a concept of a "change time" for meta data
(though that would be nice).  How's that for compatibility ;)

NOTE: I am a C programmer and new to python, so can anyone comment
on what the st_ctime value is when os.stat() is called on Windows?

Kris
On 9/28/12 9:25 AM, Chris Angelico wrote:
> On Sat, Sep 29, 2012 at 1:18 AM, Christian Heimes <christian@python.org> wrote:
>> Am 28.09.2012 17:07, schrieb Chris Angelico:
>> In the future please read the manual before replying! ;) You are wrong,
>> ctime is *not* the creation time. It's the change time of the inode.
>> It's updated whenever the inode is modified, e.g. metadata modifications
>> like permission changes, link/unlink of hard links etc.
>
> Whoops, my bad! Sorry. I was remembering some other APIs with similar
> terminology.
>
> Lesson: Check the docs, they're more reliable.
>
> ChrisA
>

-- 
This message is NOT encrypted
--------------------------------
Mr. Kristen J. Webb
Chief Technology Officer
Teradactyl LLC.
2301 Yale Blvd. SE.
Suite C7
Albuquerque, NM 87106
Phone: 1-505-338-6000
Email: kwebb@teradactyl.com
Web: http://www.teradactyl.com

	Home of the

  True incremental Backup System
--------------------------------
NOTICE TO RECIPIENTS: Any information contained in or attached to this message 
is intended solely for the use of the intended recipient(s). If you are not the 
intended recipient of this transmittal, you are hereby notified that you 
received this transmittal in error, and we request that you please delete and 
destroy all copies and attachments in your possession, notify the sender that 
you have received this communication in error, and note that any review or 
dissemination of, or the taking of any action in reliance on, this communication 
is expressly prohibited.


Regular internet e-mail transmission cannot be guaranteed to be secure or 
error-free. Therefore, we do not represent that this information is complete or 
accurate, and it should not be relied upon as such. If you prefer to communicate 
with Teradactyl LLC. using secure (i.e., encrypted and/or digitally signed) 
e-mail transmission, please notify the sender. Otherwise, you will be deemed to 
have consented to communicate with Teradactyl via regular internet e-mail 
transmission. Please note that Teradactyl reserves the right to intercept, 
monitor, and retain all e-mail messages (including secure e-mail messages) sent 
to or from its systems as permitted by applicable law.


[toc] | [prev] | [next] | [standalone]


#30525

FromNobody <nobody@nowhere.com>
Date2012-09-29 20:24 +0100
Message-ID<pan.2012.09.29.19.24.13.700000@nowhere.com>
In reply to#30419
On Fri, 28 Sep 2012 11:48:23 -0600, Kristen J. Webb wrote:

> NOTE: I am a C programmer and new to python, so can anyone comment
> on what the st_ctime value is when os.stat() is called on Windows?

The documentation[1] says:

    st_ctime - platform dependent; time of most recent metadata change on
    Unix, or the time of creation on Windows) 

[1] http://docs.python.org/library/os#os.stat

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web