GNU bug report logs - #11798
touch date bug

Previous Next

Package: coreutils;

Reported by: Patrick Castet <castet02 <at> yahoo.fr>

Date: Wed, 27 Jun 2012 16:17:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11798 in the body.
You can then email your comments to 11798 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#11798; Package coreutils. (Wed, 27 Jun 2012 16:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Patrick Castet <castet02 <at> yahoo.fr>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 27 Jun 2012 16:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Patrick Castet <castet02 <at> yahoo.fr>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Cc: "castet01 <at> yahoo.fr" <castet01 <at> yahoo.fr>,
	"castet02 <at> yahoo.fr" <castet02 <at> yahoo.fr>
Subject: touch date bug
Date: Wed, 27 Jun 2012 10:52:27 +0100 (BST)
[Message part 1 (text/plain, inline)]
bug-coreutils <at> gnu.org

Hi, 

if you try this


$ touch a0.a
$ touch -d "20000102 03:04:05" a0.a
you get 
$ ls -la a0.a
-rw-r--r-- 1 dmi Aucun 0  2 janv.  2000 a0.a

AND 


if you check with widows  cmd, you get 

C:\cygwin\tmp>dir
 Le volume dans le lecteur C n'a pas de nom.
 Le numéro de série du volume est B8F8-5FC7

 Répertoire de C:\cygwin\tmp

27/06/2012  11:47    <REP>          .
27/06/2012  11:47    <REP>          ..
02/01/2000  04:04                 0 a0.a


SO

a0.a is dated with  20000102 04:04


wich is not correct !

enjoy ;-)

pc
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#11798; Package coreutils. (Wed, 27 Jun 2012 16:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 11798 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Patrick Castet <castet02 <at> yahoo.fr>
Cc: 11798 <at> debbugs.gnu.org, "castet01 <at> yahoo.fr" <castet01 <at> yahoo.fr>
Subject: Re: bug#11798: touch date bug
Date: Wed, 27 Jun 2012 09:23:12 -0700
On 06/27/2012 02:52 AM, Patrick Castet wrote:
> touch -d "20000102 03:04:05" a0.a

This works for me, on GNU/Linux:

$ touch -d "20000102 03:04:05" a0.a
$ ls -l --full-time a0.a
-rw-r--r--. 1 eggert eggert 0 2000-01-02 03:04:05.000000000 -0800 a0.a

I expect the problem that you're having with Windows
has to do with the file system or the Windows clock,
not with "touch" per se.  That is, I expect you'll
see the same problem regardless of whether "touch"
is used to set the file time stamp.




Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Wed, 27 Jun 2012 16:35:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Wed, 27 Jun 2012 16:35:01 GMT) Full text and rfc822 format available.

Notification sent to Patrick Castet <castet02 <at> yahoo.fr>:
bug acknowledged by developer. (Wed, 27 Jun 2012 16:35:02 GMT) Full text and rfc822 format available.

Message #15 received at 11798-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Patrick Castet <castet02 <at> yahoo.fr>
Cc: 11798-done <at> debbugs.gnu.org, "castet01 <at> yahoo.fr" <castet01 <at> yahoo.fr>
Subject: Re: bug#11798: touch date bug
Date: Wed, 27 Jun 2012 10:29:56 -0600
[Message part 1 (text/plain, inline)]
tag 11798 notabug
thanks

On 06/27/2012 03:52 AM, Patrick Castet wrote:

> $ touch a0.a
> $ touch -d "20000102 03:04:05" a0.a

Thanks for the report.

> if you check with widows  cmd, you get 

I assume you meant Windows, not widows.

> 
> a0.a is dated with  20000102 04:04
> 
> 
> wich is not correct !

Welcome to the joys of Microsoft's decision to store file timestamps
with respect to local timezones rather than with respect to UTC, even
though that means that physically relocating your machine to a spot with
different daylight savings rules renders those timestamps ambiguous.
The difference of one hour that you are seeing is due to Windows'
insistence on applying a (possibly wrong) daylight savings adjustment,
based on the timestamp on the file vs. what Windows considers as your
current time zone.

Furthermore, since this is an issue that you noticed with the cygwin
port of coreutils, you might be better off asking on the cygwin list.
Perhaps they will agree, and consider this a bug in cygwin1.dll for
converting timestamps in the futimens() and or stat() functions into
file timestamps in a manner inconsistent with Windows daylight savings
gyrations; but more likely the cygwin folks will state that there is
nothing that can be done about the mismatch in opinions on how daylight
savings affect Window file time stamps.

At any rate, this is a Windows or cygwin issue, not an upstream one, so
I'm closing out this upstream bug as a non-issue.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#11798; Package coreutils. (Thu, 28 Jun 2012 05:38:02 GMT) Full text and rfc822 format available.

Message #18 received at 11798 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Patrick Castet <castet02 <at> yahoo.fr>, 11798 <at> debbugs.gnu.org
Subject: Re: bug#11798: touch date bug
Date: Wed, 27 Jun 2012 23:33:40 -0600
Eric Blake wrote:
> Patrick Castet wrote:
> > $ touch a0.a
> > $ touch -d "20000102 03:04:05" a0.a
> > if you check with widows  cmd, you get 
> > a0.a is dated with  20000102 04:04
> > 
> > wich is not correct !
> 
> Welcome to the joys of Microsoft's decision to store file timestamps
> with respect to local timezones rather than with respect to UTC, even
> though that means that physically relocating your machine to a spot with
> different daylight savings rules renders those timestamps ambiguous.
> The difference of one hour that you are seeing is due to Windows'
> insistence on applying a (possibly wrong) daylight savings adjustment,
> based on the timestamp on the file vs. what Windows considers as your
> current time zone.

Additionally it appears you are operating on a FAT filesystem.  MS FAT
filesystems represents times with only a 2-second resolution.  This
causes all timestamps to be even second values.  Odd second values are
modified to fit.  This is the :05 time being set to :04 that is
illustrated above.

This problem for example caused 'rsync' to include a --modify-window
option so that it can be used like --modify-window=1 to allow times to
differ by up to 1 second to work around this issue.

Bob




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 26 Jul 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.