X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Rugxulo Newsgroups: comp.os.msdos.djgpp Subject: Re: argv[0] Date: Sun, 4 Dec 2011 11:46:35 -0800 (PST) Organization: http://groups.google.com Lines: 21 Message-ID: <6719f201-2317-420d-bb38-3be66c90140b@q9g2000yqe.googlegroups.com> References: <16b04d29-8317-4c7f-929c-1a22a328fa32 AT p9g2000vbb DOT googlegroups DOT com> <9bf257a7-a0f8-43ba-a65f-36c6027f68cb AT r28g2000yqj DOT googlegroups DOT com> NNTP-Posting-Host: 65.13.115.246 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1323027995 18084 127.0.0.1 (4 Dec 2011 19:46:35 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Sun, 4 Dec 2011 19:46:35 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: q9g2000yqe.googlegroups.com; posting-host=65.13.115.246; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKRAUELSC X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.630.0 Safari/534.16,gzip(gfe) Bytes: 2618 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id pB4K026d007828 Reply-To: djgpp AT delorie DOT com Hi, On Dec 4, 11:26 am, Georg wrote: > > Rayer may have pointed out correctly that this is all too complicated > and could be replaced by reading the value in argv[0]. But I observed > that when I start my code with "redir" argv[0] will not return the > full path. Plus DJ Delorie's post made me uncertain whether I should > use argv[0]. Well, if it's non-portable and unreliable on *nix, you might get some hate mail for breaking that. (Not that they don't always do it to us, of course.) On those systems, I believe they make it a compile-time constant or use env. var. to point to config directory (which is what I assume you're trying to do). Nobody mentioned that the DJGPP stub lets you fake something else, e.g. "gunzip.exe" can be a very small 2 kb .EXE file that runs "gzip - d" (as long as in same directory). That's one complication. Another is probably the loading of the DJGPP.ENV file (mostly used by GCC itself but also?? by user programs, I suppose).