delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/01/12:32:11

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 1 Oct 2009 18:31:50 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: rename oddity on 1.5
Message-ID: <20091001163150.GN7193@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <loom DOT 20091001T180744-655 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20091001T180744-655@post.gmane.org>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Oct  1 16:25, Eric Blake wrote:
> I'm debating about doing one final coreutils drop for cygwin 1.5, since 
> coreutils 6.10 is comparatively old compared to the upcoming 7.7.  In the 
> process, I'm trying to write a wrapper for coreutils to work around various 
> rename(2) bugs (my patch for coreutils already deals with bugs in Solaris 9 and 
> 10, and NetBSD 1.6).  For the good news, the testsuite for coreutils passes all 
> rename(2) tests on a self-built cygwin 1.7 without needing any wrapper (self-
> built, because cgf has not yet checked in his patch to fix a/.// detection).
> 
> But I'm running into a weird case on cygwin 1.5.  I've got two machines, both 
> running Windows XP, but the same sequence of commands on the two machines gives 
> different behavior.  Can anyone explain this, other than a possibility of BLODA?
> 
> $ mkdir a b
> $ touch a/f
> $ mv -T a b
> $ rm b/f
> $ rmdir b
> $ ls
> 
> On one machine, this works as expected, but on the other, the rmdir action 
> brings directory 'a' back into existence.  The problem looks like it only 
> occurs when moving a non-empty directory to overwrite an empty one.
> 
> I can work around it - in the wrapper, call rmdir(dst) if destination exists 
> and is a directory, prior to calling rename(src,dst).  But I'd like an 
> explanation of why I need to do it, if anyone knows, since it means the rename 
> operation is no longer atomic.

Did you try to look what happens in sysinternal's procmon?


Corinna

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

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

- Raw text -


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