Re: soft links vs hard links (was Re: duplicate binaries)
dan writes:
> Shouldn't files like egrep and fgrep be symbolic links to grep, and same
> for any other program like this?
I wrote:
> What's wrong with hard links for this?
> If you have hard links, and replace one of them, you still need to
> replace the other one, since it still points to the original file.
No. If you have hard links and replace one of them, you replace the
original file.
> If you have soft links and replace the real file, the soft link points to
> the correct file immediately.
The only reason exactly one of egrep, fgrep or grep would be replaced is
if the maintainer split it out as a seperate binary. The maintainer would
arrange for the appropriate link to be removed before the binary was
installed. No problem.
> In addition, hard links cannot exist across file systems, which means
> that if you used them, you would have to check if both links are on the
> same file system, and otherways make a soft link anyway. This would
> introduce the need for different maintenance routines depending on the
> physical layout of directories on file systems, which is Definitely Not
> What You Want.
Egrep, fgrep, and grep are all in the same directory. In this case hard
links are exactly what you want.
--
John Hasler This posting is in the public domain.
john@dhh.gt.org Do with it what you will.
Dancing Horse Hill Make money from it if you can; I don't mind.
Elmwood, Wisconsin Do not send email advertisements to this address.
Reply to: