Get process name w/o using argv[0] in C function?

Paul Chamberlain tif at doorstop.austin.ibm.com
Tue Aug 7 03:54:29 AEST 1990


In article <1990Aug6.115204.20113 at specialix.co.uk> jonb at specialix.co.uk (Jon Brawn) writes:
>davecb at yunexus.YorkU.CA (David Collier-Brown) writes:
>>   Er, that substitutes a globally callable function for a globally
>>referable variable.  Net gain? more code to do the same thing, value
>>is read-only.  
>    ^^^^^^^^^^
>Course its read only! When was the last time you wanted to change the name
>that you where invoked as? Shouldn't be allowed!

Humorous mis-interpretation here.  Try "the value of this is change is only
visual."  I agree that by using the function calls to save/retrieve the
program name, you have eliminated the global.  But this much effort for
such a trivial function is IMNHO inappropriate for anything besides a
class-room.

The strict rules of a class-room have been discussed here many times.  And
IMNHO they teach important large-project habits using near-trivial examples
due to the time limitations.  I think they expect you to eventually forget
these really really strict rules (for the small projects) but then remember
them when they are really necessary for the large-project stuff.

Is there a comp.edu group for the ensuing flames?

Paul Chamberlain | I do NOT represent IBM         tif at doorstop, sc30661 at ausvm6
512/838-7008     | ...!cs.utexas.edu!ibmaus!auschs!doorstop.austin.ibm.com!tif



More information about the Comp.unix.questions mailing list