www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/19/19:49:00

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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 19 Feb 2004 19:48:33 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Parker, Ron" <rdparker AT butlermfg DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Strange symlink and mv interaction
In-Reply-To: <71A0F7B0F1F4F94F85F3D64C4BD0CCFE05A0400F@bmkc1svmail01.am.mfg>
Message-ID: <Pine.GSO.4.56.0402191938190.22216@slinky.cs.nyu.edu>
References: <71A0F7B0F1F4F94F85F3D64C4BD0CCFE05A0400F AT bmkc1svmail01 DOT am DOT mfg>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Thu, 19 Feb 2004, Parker, Ron wrote:

> From inside of ~/src/myprojects I did a:
>
> 	mv -- --1.2 ~/tla--escapes--1.2
>
> where "--1.2" was a directory in ~/src/myprojects.  This did not move
> ~/src/myprojects/--1.2 to ~/src/tla--escapes--1.2.  What it did do was move
> it to /cygdrive/c/tla--escapes--1.2.

Tilde expansion is usually done by the shell.  However, judging from the
rest of your message, you meant the above to say

	mv -- --1.2 ../tla--escapes--1.2

More below.

> Here are the pertinent paths:
>
> /			is a binary system mount of	C:\cygwin
> /c			is a binary system mount of	C:\
> /home			is a binary system mount of	C:\home
> ~			is				/home/rdparker
> ~/src			is a directory,			/home/rdparker/src
> ~/src/myprojects	is a symlink to			/c/MyProjects
>
> The symlink is just intended to graft my Windows source into my preferred
> ~/src working location for use with reasonable tools.
>
> It appears that when mv did a ".." from ~/src/myprojects, it actually did a
> .. from /c/MyProjects not from ~/src/myprojects.  Is this the expected
> behavior?

This is the expected behavior.  The symlink takes you to the directory,
but the ".." uses the actual parent directory entry, which points to /c.
If you want this to work seamlessly, create an actual "~/src/myprojects"
directory, and use 'mount' to map /c/MyProjects to
/home/rdparker/src/myprojects.

> I don't have a *nix system handy to check out how .. works with
> symlinked directories.

The above is rather logical if you think about it.  FWIW, it does work the
same way on Linux (not surprisingly).

> I left my laptop at home today and my wife shut off my ssh box at home
> because the fan was scaring her rabbit.  (Hmm... how do small pets
> respond to contact with an Athlon?  I smell hasenpfeffer.  Sorry PETA,
> it's been a _long_ day.)

Just keep the rabbit out of the fan... :-)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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