Re: [SLUG] Virtual Folder

From: Dylan William Hardison (dylanwh@tampabay.rr.com)
Date: Wed Jun 23 2004 - 17:51:56 EDT


Spake Ronan Heffernan on Wednesday, June 23, 2004 at 04:53PM -0400:
> Dylan William Hardison wrote:
>
> >>done properly, konq shouldn't know the difference
> >>between ln -s and a real dir.
> >>
> >>
> >
> >Not quite true.
> >
> >Given the layout:
> >
> >% tree
> >.
> >|-- baz -> foo/bar
> >|-- foo
> >| `-- bar
> >`-- test
> >
> >
> >% 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.
>

Truth, however the '..' entry in a directory doesn't change.

link/.. is target/..'s.

If you never use ..'s, then you have no problems.

for directories, mount --bind is better then a symbolic link.

-- 
"Everything that can be invented, has been invented." 
             -- Charles H. Duell, 1899 
-
GPG Fingerprint=D67D 2B75 53C6 9769 30E4  D390 239F C833 F32C F6F6
GPG KeyID=F32CF6F6
-----------------------------------------------------------------------
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:58 EDT