Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif From: tif@doorstop.austin.ibm.com (Paul Chamberlain) Newsgroups: comp.unix.questions Subject: Re: Get process name w/o using argv[0] in C function? Message-ID: <3059@awdprime.UUCP> Date: 6 Aug 90 17:54:29 GMT References: <9220003@hpldsla.sid.hp.com> <3802@auspex.auspex.com> <1990Aug2.143551.7104@specialix.co.uk> <13476@yunexus.YorkU.CA> <1990Aug6.115204.20113@specialix.co.uk> Sender: news@awdprime.UUCP Reply-To: tif@doorstop.austin.ibm.com (Paul Chamberlain) Organization: IBM AWD, Austin, TX Lines: 25 In article <1990Aug6.115204.20113@specialix.co.uk> jonb@specialix.co.uk (Jon Brawn) writes: >davecb@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@doorstop, sc30661@ausvm6 512/838-7008 | ...!cs.utexas.edu!ibmaus!auschs!doorstop.austin.ibm.com!tif