delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/01/23:28:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: ericblake AT comcast DOT net (Eric Blake)
To: cygwin AT cygwin DOT com, beau <phaedral AT gmail DOT com>
Subject: Re: revisiting case sensitivity
Date: Sat, 02 Apr 2005 04:28:16 +0000
Message-Id: <040220050428.23864.424E1F5F000E79ED00005D3822007340760A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

> > #!/bin/sh
> > /bin/mv "${1%%/}" "${1%%/}-$$" && mv "${1%%/}-$$" "${2%%/}"
> > -------------------- END /usr/local/bin/mvv --------------------
> >
> > Is this pretty much the final word at the moment?
> 
> I suppose it is.  I'm still getting the "are the same file" failure
> (which, BTW, only occurs with check_case:relaxed or check_case:adjust --
> with check_case:strict the error is "Filename exists with different
> case").
> 

Right now, on the relaxed and adjust case, stat(2) returns the same results for the two spellings, hence mv(1) thinking the files are the same without even trying a rename.  For the strict case, one stat(2) succeeds, and the other fails, so mv(1) goes on to perform rename(2), which fails because of the case difference.  POSIX requires rename(2) to be atomic, and there is no way for Windows to do that (you really do have to use an intermediate file name), so cygwin returns ECASECLASH, an invented errno, instead.

I don't know if it is worth my time as coreutils maintainer to write a cygwin specific patch to allow `mv a A' to succeed, by using an intermediate file, but PTC if someone else wants to contribute something.  Is anyone using an HFS+ file system on Mac (another case-preserving case-insensitive system) that can report what happens on that version of `mv a A'?  Does this corner case warrant an upstream request in coreutils to gracefully handle this?  Or someone could contribute a patch to cygwin to at least allow rename(2) to succeed, even though that will only help the strict case checking, not the relaxed or adjust forms where mv(1) doesn't even get to the rename(2).

--
Eric Blake



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

- Raw text -


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