On Thursday, January 15, 2004, at 02:12 PM, John Delacour wrote:
At 12:57 pm +0100 15/1/04, Stephan Hochhaus wrote:
is the file /usr/bin/perl just a link to /usr/bin/perl5.8.1 and could therefore easily replaced by /usr/local/bin/perl5.8.2 (as an example)? Or would that break anything?
Provided you install the later version in Apple's default location, /usr/bin/perl will be overwritten with perl 5.8.2, 5.8.3 or whatever and will be identical to the latest installation. This is how things look in my directory:
-rwxr-xr-x 2 root wheel 987340 8 Jan 19:47 perl -rwxr-xr-x 1 root wheel 987076 9 Nov 13:56 perl5.8.1 -rwxr-xr-x 1 root wheel 21924 18 Nov 10:14 perl5.8.2 -rwxr-xr-x 2 root wheel 987340 8 Jan 19:47 perl5.8.3
John: "overwritten" is the wrong term here, "linked" would be better - your 'perl' and 'perl5.8.3' files are linked to the same inode. That's why they have a 2 in the first numerical column, while the other two files have a 1. Here's an excerpt from `man ls`:
If the -l option is given, the following information is displayed for
each file: file mode, number of links, owner name, group name, number of
bytes in the file, abbreviated month, day-of-month file was last modi-
fied, hour file last modified, minute file last modified, and the path-
name.
Stephan: there's no way to tell a hard link from a "regular file", because creating a hard link to an existing file simply creates an additional way to access the existing file's inode through a different name. After creating the link, the original file and the new file have equal status, neither is subordinate to the other anymore. To see whether two files point to the same inode, you can do `ls -i`.
This is all in contrast to "soft links", i.e. symbolic links, which point by name to the original file, and remain subordinate to it. If you deleted the original file, a hard link would work fine but a soft link wouldn't work anymore.
-Ken
