| Author |
Why would a person name link a filename to itself
|
|
| grocery_stocker 2008-01-29, 10:23 pm |
| Given.
$ which ft
/usr/local/bin/ft
$ ls -al /usr/local/bin/ft
lrwxr-xr-x 1 root wheel 8 Aug 12 15:31 /usr/local/bin/ft ->
ft-0.9.2
$ which ft-0.9.2
/usr/local/bin/ft-0.9.2
Both 'ft' and 'ft-0.9.2' are internet forum programs. Why would a
person compile 'ft', then compile the exact thing and call it
'ft-0.9.2' and then have 'ft' link to it?
| |
| Todd H. 2008-01-30, 4:34 am |
| grocery_stocker <cdalten@gmail.com> writes:
> Given.
>
> $ which ft
> /usr/local/bin/ft
> $ ls -al /usr/local/bin/ft
> lrwxr-xr-x 1 root wheel 8 Aug 12 15:31 /usr/local/bin/ft ->
> ft-0.9.2
> $ which ft-0.9.2
> /usr/local/bin/ft-0.9.2
>
>
> Both 'ft' and 'ft-0.9.2' are internet forum programs. Why would a
> person compile 'ft', then compile the exact thing and call it
> 'ft-0.9.2' and then have 'ft' link to it?
It's not at all uncommon for installers/make files/package managers to
create symbolic links using a generic name that actually link to a
specific version.
The make file in this case likely created /usr/local/bin/ft-0.9.2
and after that ln -s /usr/local/bin/ft-0.9.2 /usr/local/bin/ft
The motivation... I'm not sure entirely, but among the nice things it
does is provide a way to have multiple versions of a binary available
(for testing) and just link to the canonical one using the program
name without the version.
Bset Regards,
--
Todd H.
http://www.toddh.net/
| |
| grocery_stocker 2008-01-30, 4:34 am |
| On Jan 29, 8:42 pm, comph...@toddh.net (Todd H.) wrote:
> grocery_stocker <cdal...@gmail.com> writes:
>
>
>
> It's not at all uncommon for installers/make files/package managers to
> create symbolic links using a generic name that actually link to a
> specific version.
>
> The make file in this case likely created /usr/local/bin/ft-0.9.2
> and after that ln -s /usr/local/bin/ft-0.9.2 /usr/local/bin/ft
>
> The motivation... I'm not sure entirely, but among the nice things it
> does is provide a way to have multiple versions of a binary available
> (for testing) and just link to the canonical one using the program
> name without the version.
Okay, I just thought about what you said and it makes perfect sense.
Thanks.
| |
| Stephane Chazelas 2008-01-30, 4:34 am |
| On 29 Jan 2008 22:42:14 -0600, Todd H. wrote:
[...]
> The make file in this case likely created /usr/local/bin/ft-0.9.2
> and after that ln -s /usr/local/bin/ft-0.9.2 /usr/local/bin/ft
[...]
More likely:
ln -s ft-0.9.2 /usr/local/bin/ft
It's generally better to use relative paths in the targets of
symlinks as this way the link still works if the directory is
mounted elsewhere.
--
Stephane
|
|
|
|