Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!news From: scs@adam.mit.edu (Steve Summit) Newsgroups: comp.lang.c Subject: Re: Strings as function names (again) Summary: No more about argv[0], please Message-ID: <1991Feb24.035359.24281@athena.mit.edu> Date: 24 Feb 91 03:53:59 GMT References: <14972@smoke.brl.mil> <8431@exodus.Eng.Sun.COM> <410@ceco.ceco.com> Sender: news@athena.mit.edu (News system) Reply-To: scs@adam.mit.edu Organization: Thermal Technologies, Inc. Lines: 23 Various people write: >> |> >>One is that you have to tell it a path to the executable file, and >> |> >>that is not in general available for the currently-executing process. >> |> >Sure? How about argv[0] ? >> [semiportable code for making best guess at program's >> executable from argv[0] and $PATH] > Your solution is interesting, but I think that here is where you >miss the point. C runs on many many many operating systems and platforms. >I have no doubt that your code will run on a sun, or most unix systems. On >the other hand, I doubt that it will run on... > The answer is, NO - there is no STANDARD way of knowing the name of >the currently exicuting file. I think the person who posted the code realized that. I KNOW that this topic has been discussed to death countless times, and that all of these arguments have been brought up before, which is why they are summarized in the comp.lang.c frequently-asked questions list. Please read that list before posting anything else on this subject, and make sure that you have something new to say. Steve Summit scs@adam.mit.edu