Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!unido!laura!heike!klute From: klute@heike.informatik.uni-dortmund.de (Rainer Klute) Newsgroups: comp.sys.atari.st.tech Subject: The program's name and path - how can I get them? Message-ID: <1990Oct8.110346@heike.informatik.uni-dortmund.de> Date: 8 Oct 90 10:03:46 GMT Sender: news@laura.UUCP Reply-To: klute@heike.informatik.uni-dortmund.de (Rainer Klute) Organization: University of Dortmund, FRG Lines: 36 Due to public demand I would like to integrate a functionality into Arcgsh (you know - the GEM shell for Arc, Zoo, LHarc etc.) that allows you to doubleclick on e. g. FOO.ZOO which causes Arcgsh to be executed and immediately showing the Zoo parameter dialog box with FOO.ZOO already filled in as the archive name. However, what I need to know is the complete path of the executing program. This is neccessary to read (resp. write) the configuration file which is in the same directory as the program itself. I played around a bit (using TOS 1.4) with shel_read() and shel_find(), but I am not satisfied with the results: - Shel_read() works reliably only when the program is called from the desktop. When it is called from a shell it may return the name of that shell. - Shel_find() needs to know the program's name in order to find out its path. It works alright if I hardcode the program's name, like strcpy (buffer, "ARCGSH.PRG"); shel_find (buffer); but will fail if the program is renamed. Another observation is that loading the resource file always worked with rsrc_load ("ARCGSH.RSC"). Does someone have a general solution? It would be sufficient to get only the directory where the program is located - without knowing the program's name. Even better would be a possibility to retrieve the program's name also, and the best would be if this could be done without GEM functions. And yes, of course only legal solutions are useful. -- Dipl.-Inform. Rainer Klute klute@irb.informatik.uni-dortmund.de Univ. Dortmund, IRB klute@unido.uucp, klute@unido.bitnet Postfach 500500 |)|/ Tel.: +49 231 755-4663 D-4600 Dortmund 50 |\|\ Fax : +49 231 755-2386