Re: [SLUG] Virtual Folder

From: Ronan Heffernan (ronanh@auctionsolutions.com)
Date: Wed Jun 23 2004 - 17:51:25 EDT


Eben King wrote:

>>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
>
On my linux box, I do indeed end up back in 'bar' (RedHat 6.2):

$ mkdir foo
$ mkdir bar
$ cd bar
$ ln -s ../foo baz
$ cd baz
$ pwd
/home/ronan/bar/baz
$ /bin/pwd
/home/ronan/foo
$ cd ..
$ pwd
/home/ronan/bar
$ /bin/pwd
/home/ronan/bar

Whether or not the programmers have to do anything special to expose the
hierarchy (and let's face it, there are two different hierarchies here),
the programmers do not have to do anything special to access the files
and subdirectories under a symlink!

--ronan

-----------------------------------------------------------------------
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:46 EDT