[Courses] [FS] Filesystem Course lesson 2

Madhavan, Srivatsan vatsan at grove.ufl.edu
Wed Jul 16 10:34:18 EST 2003


> On Wed, 16 Jul 2003 11:46 pm, Dan Richter wrote:
> > >ln interprets the pathname of the actual file/directory relative to
> > >the directory which is to contain the symbolic link.
> >
> > Yes, that's sum total of the relativity of symbolic links.
>
>
> So really it is not symbolic links that are relative, but rather the
utility
> that creates them that behaves in a strange way.


symbolic names or 'soft links' are "names" - ie, a file is created that
'links' to a
'name'. So if you created a symbolic link 'bar' to the name
'../foo' - then 'bar' would *always* try to resolve to '../foo'
irrespective of what your CWD might be. so it is upto the creator of the
soft
link to determine if the soft link were relative or not. For eg, if you
created
a softlink to /usr/local/bin, it would never be relative. but if you created
a
soft link to 'bin' while your CWD is /usr/local, the soft link would indeed
be relative.

this is in contrast with 'hard' links that link to inodes. in this case,
there is no ambiguity at all. The reason hard links are not popular, imo,
is that they can not span filesystems. soft links work everywhere, so they
get used everywhere!


~vatsan

Nobody can be exactly like me. Even I have trouble doing it.
Reaching after something, touching nothing, is all I ever do.



More information about the Courses mailing list