Subject: Re: Support for st_birthtime
From: Corinna Vinschen <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 26 Mar 2007 17:28:45 +0200
List-Id: <cygwin.cygwin.com>

On Mar 26 14:10, James Youngman wrote:
> On 3/26/07, Eric Blake <[email-masked]> wrote:
> >Corinna only replied to the cygwin list.  It looks like Windows will
> >populate st_birthtime with st_ctime when reading filesystems that don't
> >support birthtime.

Er, sorry, but I didn't say that.  I said that all Windows functions
returning filetimes will return a creation time.  We can only work with
the values given.  I never found a situation in which the creation time
is not set.  And if it's set, we must trust the value.

Native Windows file systems always maintain a real creation time and
Samba fakes it.  Samba sets the creation time to the minimum value of
the stat members st_ctime, st_mtime and st_atime.

The only timestamp I ever found to be 0 is the ChangeTime.  This is the
fourth timestamp maintained by the SMB protocol as well as by native NT
functions and it's meaning is equivalent to st_ctime.  This timestamp is
not returned by Win32 funtions, but Cygwin uses the native NT functions
so we get a valid st_ctime as long as the file system supports it.  NTFS
returns a valid ChangeTime.  FAT returns 0, in which case Cygwin sets
st_ctime = st_mtime.

Unfortunately Samba sets the ChangeTime not to st_ctime, but to
st_mtime, even if the underlying filesystem supports st_ctime.  However,
as I mentioned above, if the timestamp is valid, we have to trust it.
We have no other way to evaluate a value.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/