Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Wed, 19 Oct 2005 19:11:28 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: please test: coreutils-5.90-3
Message-ID: <20051019171128.GR32583@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <Pine.OSF.4.21.0510181859340.2152-101000@ax0rm1.roma1.infn.it> <loom.20051019T160122-280@post.gmane.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <loom.20051019T160122-280@post.gmane.org>
User-Agent: Mutt/1.4.2i

On Oct 19 14:23, Eric Blake wrote:
> Angelo Graziosi <Angelo.Graziosi <at> roma1.infn.it> writes:
> 
> > 1)
> > Using coreutils-5.90-3 I have observed  that the command 'cp -p' does not
> > preserve the timestamp of a file:
> > 
> > $ ls -lrt
> > -rw-r--r-- 1 Administrator Administrators    418 Aug  7 18:55 t.c
> > 
> > $ cp -p t.c t.cpp
> > $ ls -lrt
> > -rw-r--r-- 1 Administrator Administrators    418 Aug  7 18:55 t.c
> > -rw-r--r-- 1 Administrator Administrators    418 Oct 18 19:05 t.cpp
> > 
> > Reinstalling coreutilis-5.3.0-9 the files have the same timestamps.
> 
> As far as I can tell, this is a bug in cygwin.
> 
> 5.3.0 made the following sequence of calls:
> dest_desc = open(dest,...);
> write(dest_desc,...);
> close(dest_desc);
> utimes(dest,...);
> chmod(dest,...);
> 
> 5.90 makes the following sequence of calls:
> dest_desc = open(dest,...);
> write(dest_desc,...);
> utimes(dest,...);  // at this point, timestamp is correct
> fchmod(dest_desc,...);
> close(dest_desc);  // oops, timestamp changed

Apparently NT overwrites the mtime timestamp on close, as long as write
buffers are not written to disk at that time.  Chris had an idea how to
work around that in Cygwin so that it should work in most cases now.
Please try the latest snapshot from http://cygwin.com/snapshots/


Corinna

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

--
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/

