delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/12/00:18:28

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: "linda w \(cyg\)" <cygwin AT tlinx DOT org>
To: <cygwin AT cygwin DOT com>
Subject: strange mv behavior: mv <mydir> <mydir>
Date: Tue, 11 Feb 2003 21:18:05 -0800
Message-ID: <000001c2d256$1fafa3a0$1403a8c0@sc.tlinx.org>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

I stumbled onto this trying to rename a dir from
"Mydir" to "mydir" (w/o capital "M")

> mv Mydir mydir 
	starts copying "Mydir" into Mydir/mydir.  

But it's not just the 'caps' that are the issue since:

> mv mydir mydir
	will start copying mydir into itself

	On lnx, I get:
mv: cannot move `mydir' to a subdirectory of itself, `mydir/mydir'

Shouldn't I get a similar error on Windows?

	Note to do the original, desired mv, I can use:
> mv Mydir foo; mv foo mydir

	Which (unfortunately), would be correct windows behavior since
you can't rename a file or dir to a different name that varies only 
in capitalization (ignore case "feature").


The problem is 'mv' isn't recognizing that source and target are
the same name (even when case matches), so it is behaving like 'cp'.

linda


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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