X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=mCAZpQ5ryDG/X4BIEJeOicP9ZTQjg0SLRPBVrCmnGHkvHFf+zx3H+
	0HWm10zSslaPqbgi157dDCvI/QaeBx/8AdNXC4cEowq0Uni5/5R8VYCWgcZ3eqcC
	c4zlRDZYuW43dBAjDjGiV1mC5Vx5RNMfLylM50lqFRu9QfE0FI6UAk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=qq58G632JV2GDRcYcHtqnfRbeE0=; b=XsRIiPvpNW9aU39BTNdmd0zh+z5b
	fCfJCRsH3EiE2TCPC5MV7AOADye0ZchD3qOvLtHDnikfB4F9+GuL67enSXQYBPE3
	X2X5nGATfcyYK7ckQrslXBjfCXmP8Ko8wQ5+WpjCdpojVsCJTcvMYMXyZqB/uZI0
	WSBrohLmo2Il3JQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-101.8 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Ronald, Hx-languages-length:1491, rights
X-HELO: drew.franken.de
Date: Tue, 11 Apr 2017 10:29:50 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: ls -t changes the cygwin-access time of a file
Message-ID: <20170411082950.GD26743@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <1491887747.2418233.940851896.58DFF258@webmail.messagingengine.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k"
Content-Disposition: inline
In-Reply-To: <1491887747.2418233.940851896.58DFF258@webmail.messagingengine.com>
User-Agent: Mutt/1.8.0 (2017-02-23)

--7iMSBzlTiPOCCT2k
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Apr 11 07:15, Ronald Fischer wrote:
> I'm running on Windows 7 64bit, the disk has NTFS, and I have Windows
> enabled to track the correct file access time.
>=20
> With Cygwin, I see the following oddity:
>=20
> -0-1- ~/gitwrk/vp5  > ls -lu c:/tmp/x*
> -rw-r--r-- 1 FISRONA Domain Users 10 Apr 11 06:59 c:/tmp/xx
> (waiting a couple of minutes)
> -0-1- ~/gitwrk/vp5  > ls -lut c:/tmp/x*
> -rw-r--r-- 1 FISRONA Domain Users 10 Apr 11 07:01 c:/tmp/xx
>=20
> I didn't touch the file in between, but the reported access time
> changed. Further experimentation shows, that the reported access time
> changes as soon as I use the -t option with ls. As long as I just do ls
> -lu, the access time does not change.

No, it changes every time you do an ls -l.  Yes, this is a bug, but it's
a bug in Windows, as old as Windows NT itself.

To fetch stat(2)-like meta information on a file, the caller has to open
the file (NtOpenFile), read the meta data (NtQueryInformationFile /
NtQuerySecurityObject) and close the file again (NtClose).

The problem is this: Even if you open the file explicitely with only
metadata access rights (READ_CONTROL | FILE_READ_ATTRIBUTES |
FILE_READ_EA), the access will count as data access and the file access
timestamp will be bumped.

Sticking to `fsutil behavior set disablelastaccess 1' works better.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--7iMSBzlTiPOCCT2k
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJY7JP+AAoJEPU2Bp2uRE+gmcwP/3hGlvTNE2FptK900UVEHTue
ZqX49bdZSA2ZjVl3pp0/FGzF44tHJDf7QAV9JyKhUUvcFAsIW4viIVGx7eRtnX3N
i/joOY4HfeHQCI9SXMBQI9JzjgYmrTeV4Eajn85V7ce5hVDWvgTWkk/as928tYGl
+eZbb9cuGaMDGtl447UJHXD/xxA5UjiIMPvATUaxQw30wjT1z1bvvzpoGcCbBDql
7IJ9r/bv7QrSmsPRAbno3obheKvX9jU2r8RT8/SQDu3h5XMtAuhvjomyb7kpXLqi
W2tyxR1OXHyTeLF8yKPRqHlfGTYiKLzSaHA+xI+Xoxp614wzVY/wxQstF+G6E/sA
bly8wA3tVvdDaWQOYK8Vek0GjpF9B1bauU23F9BmZPgCdz1dyUfzpW02gxBEycQk
gjTy1M7iaKU5tl7OKoAEy+0tNi1xg6IgbgLRzLLltLn1NOY/33ruu9fa6uDPx/2v
q38n5nO51CmqnrzRcHRYQIrQGmsmSPcxGsK8lYk3r1mm4pCnXWB7SkirT5O9vUWT
qqSDEJi5SQOKMCZvC22+7pMQYW1OT9KSVjhY1E0V3JNnemaVuioF+oi4tlSF40vh
bxUNiT1iA+4cIToNQC7dvqz2eRC3heL1ZudW3WZkOZ8jRP9bc/zEbD0dUaWnLtyr
/kk+Ol14ZcUHdcpRLame
=QWtd
-----END PGP SIGNATURE-----

--7iMSBzlTiPOCCT2k--
