Mail Archives: djgpp/2002/08/22/10:24:24
> Date: Thu, 22 Aug 2002 15:09:59 +0200
> From: Daniel Taupin <taupind AT wanadoo DOT fr>
>
> 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.
- Raw text -