delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/13/10:41:51

X-Spam-Check-By: sourceware.org
Date: Mon, 13 Aug 2007 10:41:24 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Ronald Fischer <ronald DOT fischer AT venyon DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: How to rename file case-sensitive?
In-Reply-To: <387E9FC1619C0849BA8934938037E54F0F5CAF@sv-muc-004.venyon-mail.local>
Message-ID: <Pine.GSO.4.63.0708131040130.17254@access1.cims.nyu.edu>
References: <387E9FC1619C0849BA8934938037E54F0F5CAF AT sv-muc-004 DOT venyon-mail DOT local>
MIME-Version: 1.0
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 Mon, 13 Aug 2007, Ronald Fischer wrote:

> Is there an easy way to rename a file foo to Foo?
>
> mv foo Foo
>
> complains that they are the same file. From the FAQ
> I learned that this is due to the limitations of
> Windows which does not distinguish between case
> in file names. The FAQ also says that there is a
> "highly experimental" case-sensitive file system
> available.
>
> Not being prepared yet to live in a highly
> experimental way, I'm curious whether there
> is a simpler solution to the rename problem
> aside from the obvious hack
>
>   mv foo bar; mv bar Foo

I use the following (which is essentially a wrapper around the hack):

$ cat /usr/local/bin/mvv
#!/bin/sh
/bin/mv "${1%%/}" "${1%%/}-$$" && mv "${1%%/}-$$" "${2%%/}"

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Belief can be manipulated.  Only knowledge is dangerous.  -- Frank Herbert

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