Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2009 17:11:08 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        John Almberg <jalmberg@identry.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: links vs real directories
Message-ID:  <20090316161108.GA13255@owl.midgard.homeip.net>
In-Reply-To: <33BEAB1A-A0AB-4684-95EE-8C2C4328ABA7@identry.com>
References:  <AA5A8761-794A-427B-9E9F-2872BD746038@identry.com> <20090316153923.GA13043@owl.midgard.homeip.net> <33BEAB1A-A0AB-4684-95EE-8C2C4328ABA7@identry.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 16, 2009 at 11:47:23AM -0400, John Almberg wrote:
> 
> On Mar 16, 2009, at 11:39 AM, Erik Trulsson wrote:
> 
> > On Mon, Mar 16, 2009 at 11:22:13AM -0400, John Almberg wrote:
> >> I always thought that links to real directories were pretty much the
> >> same as real directories, but I've just discovered a situation where
> >> they are not and I'm wondering if I'm doing something wrong...
> >
> > A *soft* link to a directory entry (be it a directory or a file or  
> > something
> > else) is not quite equivalent to the original entry since they are  
> > easily
> > distinguished and some programs do treat softlinks differently from  
> > other
> > targets.
> 
> I can see that, now... If I create a soft link to ~/shared/config,  
> and then cd into the directory, when I type 'ls ..', I get the  
> listing for ~/shared, not ~/app.

Yes, because '..' is a hardlink to the parent directory, and 'cd' does not
know how you got to ~/shared/config so it does not know anything about the
softlink used to get theere.


> 
> Bummer...
> 
> I've just dug through man ln, and don't see any obvious solution.  
> Since this must be a problem for anyone who wants to do something  
> like this, I guess I am taking the wrong approach, altogether.
> 
> Will have to re-think this....
> 
> <smell of burning rubber commences...>
> 
> -- John
> 

-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090316161108.GA13255>