Article View: comp.sys.amiga.tech
Article #1389Re: Links
From: William F. Hammond
Date: Sat, 23 Sep 1989 17:08
Date: Sat, 23 Sep 1989 17:08
43 lines
3026 bytes
3026 bytes
In article <4174@mentor.cc.purdue.edu>, ain@mentor.cc.purdue.edu
(Pat-bob White) writes:
> ...
> Actually, the feature *can* save you lots of disk space. eg: compress.
> Compress, uncompress, and zcat all use enough of the same code that
> they are designed to look at argv[0] and decide how to act. The additional
> code to do the check and make the change in operation was far less than two
> more copies of the program would be. (BTW, even the Amiga version of
> compress that was ported from unix still does this.)
> So, soft links (or a shell that does "aliases" a certain way), would
> suffice for getting three separate prorgams from one. (a shell would have to
> pass the aliased name as argv[0] to the program.. not difficult)
> I know one could just add options to the program to control its
> functioning, but sometimes it is nice to just be able to type "zcat foo.Z"
> rather than "compress -dc foo.Z".
>
> Pat White
> ARPA/UUCP: j.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421
> U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906
*******************************************************************************
The trouble with programs whose behavior depends on (a) the command line
entry or (b) the filename is that they are a bit tricky for an environment
that is as "uncontrolled" as the Amiga's. There is too much risk of my
wanting to have two different but closely related programs from different
authors around at the same time with "naming" conflicts for me to be happy
with behavior that depends on a hard-coded name. For example, there was a
period earlier this year when I found myself wanting to have two different
versions of "execute" handy. If our concern is with redundant code in the
"system", we should use libraries. (What a magnificent job of squeezing the
library concept for all it's worth has been done in ARP 1.3!) (In a sense
one can think of the ARP commands as being "links".)
And if it's too much trouble to type
"compress -dc foo.Z" ,
then we type once
"alias zcat compress -dc " .
P.S. "argv[0]" *ought* to be the filename rather than the command line entry.
------------------------------------------------------------------------
William F. Hammond Dept. of Mathematics & Statistics
518-442-4625 SUNYA
wfh58@leah.albany.edu Albany, NY 12222
-------------------------------------------------------------------------
Technical Details
Message-ID:
<2045@leah.Albany.Edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!rpi!leah!wfh58References:
<8909180737.AA29741@postgres.Berkeley.EDU> <4174@mentor.cc.purdue.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!rpi!leah!wfh58 From: wfh58@leah.Albany.Edu (William F. Hammond) Newsgroups: comp.sys.amiga.tech Subject: Re: Links Summary: How about "alias zcat compress -dc []"? Keywords: Link are bad Message-ID: <2045@leah.Albany.Edu> Date: 23 Sep 89 17:08:31 GMT References: <8909180737.AA29741@postgres.Berkeley.EDU> <4174@mentor.cc.purdue.edu> Organization: The University at Albany, Computer Services Center Lines: 43