Be careful -- if you have an application "say /usr/local/whatever/foo" that is linked from "/usr/local/bin/bar" then when you call "/usr/local/bin/bar" it will populate "bar" as the argv[0] element. This may be what you want, but then again, perhaps you want to know that "foo" is the application being called.
"__progname" *should* ensure that "foo" is is being used when doing things like opening app-name specific logs etc. On 5/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I usually write a usage function to take a single argument, i.e. usage(const char *progname). When I call usage(), which is always from main(), I just pass in argv[0]. I'm under the impression that argv[0] being set to the name of the program is standard (could be wrong though).