[X-Unix] Utility "ln" makes a copy instead of hard link?

Philip J Robar pjrobar at areyoureallythatstupid.org
Fri Apr 7 14:11:17 PDT 2006


On Apr 7, 2006, at 1:56 PM, Doug McNutt wrote:

> It's curious but bash and sh, and also tcsh and csh, are usually  
> hard links to single files that behave a bit differently depending  
> on their names.
>
> In OS neXt that's not true. The files are copies and I'm pretty  
> sure there are other examples.
>
> I have been told that the reason is that Apple's hack to the HFS+  
> file system to make hard links work is so slow that Apple uses  
> copies for speed.

In OS X 10.4.6 *csh are hard links:

 > ls -li *csh
3441155 -r-xr-xr-x   2 root  wheel  347016 Aug 22  2005 csh
3441155 -r-xr-xr-x   2 root  wheel  347016 Aug 22  2005 tcsh

on the other hand sh and bash are not:

 > ls -li bash sh
3441151 -rwxr-xr-x   1 root  wheel  581636 Aug 22  2005 bash
3441179 -r-xr-xr-x     1 root  wheel  581636 Aug 22  2005 sh
 > diff bash sh
 >

Curious indeed.


Phil
--
"Voice or no voice, the people can always be brought to the bidding  
of the leaders. That is easy. All you have to do is tell them they  
are being attacked, and denounce the pacifists for lack of patriotism  
and exposing the country to greater danger. It works the same in any  
country."
-- Hermann Goering



More information about the X-Unix mailing list