From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,814d0ec938d6e4da X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-27 01:18:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail From: "Eric G. Miller" Subject: Re: How to find directory where the program is? Newsgroups: comp.lang.ada Message-ID: References: <3CC6D15A.2070509@mail.com> <3cc73115.426446486@news.cis.dfn.de> <3CC9459E.7A49A4F7@nbi.dk> User-Agent: Pan/0.11.2 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Preben Randhol" Date: Sat, 27 Apr 2002 08:18:51 GMT NNTP-Posting-Host: 216.119.41.44 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1019895531 216.119.41.44 (Sat, 27 Apr 2002 01:18:51 PDT) NNTP-Posting-Date: Sat, 27 Apr 2002 01:18:51 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:23164 Date: 2002-04-27T08:18:51+00:00 List-Id: In , Preben Randhol wrote: > In comp.lang.ada, you wrote: >> Hi Preben, >> >> Perhaps you should consider putting a hidden file in the user's >> home directory. >> >> Many programs use this technique, not only for user preferences >> but for the location of files. >> >> By way of example, here are some hidden files in my home directory >> on a Linux machine, showing that the practice is widespread. > > Actually I will put a hidden directory to store all the user settings. The standard method on Linux would be system-wide settings in /etc/.conf or /etc//. That'd be an appropriate place to put the paths for everything else. Another option is to ship a start-up script that sets some environment variables for you and then executes the real image. That's a fairly common way to keep platform paths out of the code, while not generally poluting the environment with extra variables except during program execution. Scripts are usually easy for system admins to modify, if needed, and can easily be generated from configure/make with a template. For Win/DOS, you can use a batch file for the same purposes.