public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Win32 FILE_BASIC_INFORMATION.*Time.QuadPart - which value should be used if filesystem does not support it, so Cygwin /usr/bin/stat lists the value as '-'?
Date: Tue, 9 Apr 2024 23:14:54 +0200	[thread overview]
Message-ID: <ZhWvznls2pyLd_YR@calimero.vinschen.de> (raw)
In-Reply-To: <CANH4o6NzSLKG3TQt6H9+kbn6aW66G0XASwjrTrBc-JVEcvss9g@mail.gmail.com>

On Apr  5 04:26, Martin Wege via Cygwin wrote:
> On Fri, Apr 5, 2024 at 2:05 AM Martin Wege <martin.l.wege@gmail.com> wrote:
> >
> > Hello,
> >
> > I have problems with debugging, so a quick help would be appreciated,
> > as I cannot figure this out after several hours of digging.
> >
> > Cygwin /usr/bin/stat returns "Birth: -" for some files. Which value
> > must the CreationTime member of FILE_BASIC_INFORMATION have to cause
> > /usr/bin/stat ti return "-"? 0, -1, or something else?
> 
> In a related matter:
> The Win32 FILE_BASIC_INFORMATION structure defines four time values:
> 
> LARGE_INTEGER CreationTime;
> LARGE_INTEGER LastAccessTime;
> LARGE_INTEGER LastWriteTime;
> LARGE_INTEGER ChangeTime;
> 
> How can a filesystem indicate if it does not support a particular
> timestamp, such as ChangeTime? Should ChangeTime.QuadPart then be -1,
> -2 or 0, or another value?

I'm not aware of a filesystem not supporting ChangeTime, that is,
st_ctime.  Usually only CreationTime (st_birthtime) is missing.

I think setting the timestamp to 0 works for indicating that this kind
of timestamp is not supported.  Cygwin is handling Windows timestamps
this way, but I can't find this in documentation ATM.

But the FS driver can also just fill the CreationTime field with the
same value as LastWriteTime or ChangeTime.  MSFT NFS does that.


Corinna

  reply	other threads:[~2024-04-09 21:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  0:05 Cygwin /usr/bin/stat returns "Birth: -", which value in FILE_BASIC_INFORMATION.CreationTime causes that? Martin Wege
2024-04-05  0:54 ` Brian Inglis
2024-04-05  1:08   ` Martin Wege
2024-04-05 15:51     ` Brian Inglis
2024-04-05  2:26 ` Win32 FILE_BASIC_INFORMATION.*Time.QuadPart - which value should be used if filesystem does not support it, so Cygwin /usr/bin/stat lists the value as '-'? Martin Wege
2024-04-09 21:14   ` Corinna Vinschen [this message]
2024-04-10  4:30     ` Brian Inglis
2024-04-10  7:59       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZhWvznls2pyLd_YR@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).