Re: [SLUG] Virtual Folder

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Jun 23 2004 - 17:36:23 EDT


On Wed, 23 Jun 2004, Ronan Heffernan wrote:

> Dylan William Hardison wrote:
>
> >>done properly, konq shouldn't know the difference
> >>between ln -s and a real dir.
> >
> >Not quite true.

> >% ls baz/..
> >bar/
> >
> >baz/.. == foo/
> >
> >So, a symlink to a directory isn't quite the same as a directory.
> >
> >Shells and file managers have to jump through hoops to make .. appear to
> >point to the "right" place.
> >
> >
> >If you really want to link a dir, use this:
> > mount --bind olddir newdir
> >
> Actually, no. If I write a C program that calls:
> fopen("baz/myfile.txt","r"); then the symlink is followed automatically
> (the file foo/bar/myfile.txt is opened). I do not have to resolve the
> link target or anything like that. The hierarchy may not be identical,
> but as a container for files, the dereferencing is automatic.

Using something like this:

.- foo/
|
:- bar/
   `- baz -> foo/

I believe the point was that if the app does nothing special, then a user
who "cd baz"es from bar/ then "cd .."s will not end up back in bar.
Hence, links aren't truly _transparent_ without extra work by the
programmers. Check this out:

[eben@pc eben]$ ln -s /usr usr
[eben@pc eben]$ cd usr
[eben@pc usr]$ pwd
/home/eben/usr
[eben@pc usr]$ /bin/pwd
/usr

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
ARIES:  The look on your face will be priceless when you find that 40lb
watermelon in your colon.  Trade toothbrushes with an albino dwarf, then
give a hickey to Meryl Streep.  -- Weird Al, _Your Horoscope for Today_

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:11:40 EDT