Date: Thu, 22 Aug 2002 17:23:51 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: taupind AT wanadoo DOT fr Message-Id: <2110-Thu22Aug2002172350+0300-eliz@is.elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <3D64E2A7.53133408@wanadoo.fr> (message from Daniel Taupin on Thu, 22 Aug 2002 15:09:59 +0200) Subject: Re: Zero-th argument NOT with long name! References: <3D64E2A7 DOT 53133408 AT wanadoo DOT fr> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 22 Aug 2002 15:09:59 +0200 > From: Daniel Taupin > > When I execure a program whose name is more then 8+3 (although my LFN > is 1) the argument 0 (i.e. the full program name) is not made of long > file names, but contains tildes in the DOS way of spelling. Right, that's a Windows ``feature''. It seems like someone at Redmond thought about old DOS programs which copy argv[0] into a string that has place for only 80 characters, the max length of DOS file names. Copying a long file name there, which could be up to 260 characters, would blow up such programs. As a result, we are forced to live with those pesky numeric tails in argv[0]. > Is there a means of getting the full long name of a program, inside its > execution? Yes, pass argv[0] to the library function _truename and use the result it returns.