delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/04/10/04:00:29

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 404DF3858D39
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1712736026;
bh=12L9FQGtjEgC6NQJQM95KT3BxNDB7cPundyIdqH98js=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=UFIWkMLJjAtGvLyzEha8v75UGI01lngh2zY7wt7bLb7jEncQZ0y6k0LzBviyO2xSx
2CeEgC6xe285EE2BC6eTEuQAzA3ODeOOUJRpwTj/N/FuAhp+brEmcKF6CaSXs5+Qzq
cDhkqAJ5LBxoOXEvTYKCTIT48f++ILLZw2BMbbVw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 634EE3858CD1
Date: Wed, 10 Apr 2024 09:59:41 +0200
To: cygwin AT cygwin DOT 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 '-'?
Message-ID: <ZhZG7TqOlelPUhlC@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CANH4o6O=kbNTptDMNOvg6+HBYTufNgv_71Be2Fn6E3w7+qprVg AT mail DOT gmail DOT com>
<CANH4o6NzSLKG3TQt6H9+kbn6aW66G0XASwjrTrBc-JVEcvss9g AT mail DOT gmail DOT com>
<ZhWvznls2pyLd_YR AT calimero DOT vinschen DOT de>
<5f0672aa-a33b-45fb-8ec6-826ad586bb66 AT SystematicSW DOT ab DOT ca>
MIME-Version: 1.0
In-Reply-To: <5f0672aa-a33b-45fb-8ec6-826ad586bb66@SystematicSW.ab.ca>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 43A80Sh6757677

On Apr  9 22:30, Brian Inglis via Cygwin wrote:
> On 2024-04-09 15:14, Corinna Vinschen via Cygwin wrote:
> > On Apr  5 04:26, Martin Wege via Cygwin wrote:
> > > On Fri, Apr 5, 2024 at 2:05 AM Martin Wege <martin DOT l DOT wege AT gmail DOT com> wrote:
> > > > 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.
> 
> R/O media like CD/DVD-R or FS w/o write support?

Oh yes, that makes sense, CDFS and the likes of them.

> > 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.
> 
> See upthread?:
> 
> Caller or application can set 0 to mean keep/return current value, caller or
> driver can set -1 to mean don't update/return current value:
> 
> https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_file_basic_information#remarks

I'm aware of that.  This remarks session is copy/pasted in other MSFT
articles, too.  But it doesn't really answer Martin's question.

It describes what a consumer (application or driver) is supposed to set
the timestamps to when passing timestamps to a filesystem driver via
ZwSetInformationFile (or its friends on the lower OS levels).

It does *not* describe the other direction of the call stack, i. e.,
what a filesystem driver is supposed to set a timestamp to, if its
underlying filesystem doesn't support this kind of timestamp.

And that's the direction Martin is asking about.


Corinna

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019