Re: mount dmg disk
Re: mount dmg disk
- Subject: Re: mount dmg disk
- From: Don Quixote de la Mancha <email@hidden>
- Date: Sun, 14 Mar 2010 20:01:35 -0700
On Sun, Mar 14, 2010 at 6:42 PM, Kyle Sluder <email@hidden> wrote:
> This is incorrect. Unix convention requires the program name be the
> first argument.
Just to clarify, there are a couple reasons for this.
The first is that one can use a single binary to implement more than
one command line program. Which identity the program adopts is
determined by the value of argv[ 0 ]. If you don't supply argv[ 0 ]
at all, the program may not know what to do. The identity is supplied
by symbolically linking the extra identities, with the link's name
being the program you want it to act as.
For example, the bash shell has lots of extra features that the
traditional Bourne shell doesn't provide. But if you execute bash as
/bin/sh, it runs in Bourne-shell compatible mode, and doesn't provide
any of those extra features.
A more extreme example is BusyBox, a single executable which
implements dozens of command-line programs for embedded Linux systems.
This saves quite a lot of both filesystem and virtual memory space by
providing just one implementation of a lot of common functionality.
The other reason is that some programs use argv[ 0 ] in error
messages, to give the name of the program. That way you can name the
executable anything you like, and error messages will always be
correct.
Don Quixote
--
Don Quixote de la Mancha
email@hidden
http://www.dulcineatech.com
Dulcinea Technologies Corporation: Software of Elegance and Beauty.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden