Subject: Re: chmod & symlink broken in 1.6
To: Greywolf <greywolf@starwolf.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 10/29/2002 21:05:11
># and i think they do. link(2) is the only questionable one. do you
># really want a hardlink to a symbolic link, or do you want a hard link
># to the actual file?
>
>Not questionable at all. A symbolic link takes an inode, while a hard
>link does not. Since link(2) explicitly creates hard links which are _by
>definition_ entries on the same device referring to the same inode, and
>thus indistinguishable from each other, if you hardlink to a symlink,
>you will have two symlinks in different places.
>
>"Whether both will work identically is left as an exercise for the reader."
ah, good point. yes, to make a hardlink to a symlink when the
location of the new link might not work would be pointless. link(2)
should, therefore, traverse the symlink.
unless you wish to rule out the possibility of creating a symlink that
points to something that doesn't exist. :)
>If you want a hard link to an actual file, readlink()/link() becomes
>the way to go.
to a point, yes.
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
werdna@squooshy.com * "information is power -- share the wealth."