On Sun, 25 Jul 1999, Andy Goth wrote:
> Then what are hard links good for?

There are two applications which do something similar. Call them xyzzy and
plugh. xyzzy gives you a help menu, but plugh is for expert users who
don't need (and don't want) a menu.

I write a better application-- better than both of them, but it
incorporates the features of both.  Everyone starts using my application
instead of the two old ones.

And I include a flag that you can set-- either menu, or no menu. But my
users get tired of always having to turn that darn menu on or off.

Soooooo, I come up with this great idea. I create two names (make that two
*file* names) for the new application, xyzzy, and plugh. These are hard
links to the same file. They both do the same thing-- launch my program.

Well, they do one thing different. They place different values into one
special variable made available to my program, which keeps track of what
filename was used to launch my program. And those two different values
are: xyzzy, and plugh.

In my application I test whether it was called with the command xyzzy. If
so, I make it act like xyzzy, menu and all.

If my application was called by the name plugh, I know this must be an
expert user-- she's calling it by the name of the old program she used to
use-- and so for her my application automatically provides no menu to take
up screen space and get in the way.

Hard links make both my user groups happy.


(Honesty in posting-- I didn't come up with any of these ideas, but I
think they are nifty. ;-)

Trivia-- xyzzy and plugh are actually magic words from the 70's computer
game "advent".


best wishes,

richard myers

Reply via email to