delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/09/29/14:58:08

Message-ID: <37F25ABD.E4B89CAD@softhome.net>
Date: Wed, 29 Sep 1999 20:30:21 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.61 [en] (Win98; I)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com
Subject: Re: Help with arg passing
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990929102924 DOT 11087N-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> On Tue, 28 Sep 1999, Laurynas Biveinis wrote:
> > 3) If LFN is converted to SFN, which version (short or long) goes to argv[0]?
> 
> What is passed to DOS is the SFN, since 214B requires it.  What the
> invoked program gets in its argv[0] (via !proxy), if it is a DJGPP
> program, is the original LFN file name with its full path prepended.
> A non-DJGPP program gets the SFN, since it has no other means of
> getting at the command line except as passed by DOS.

If this above is true, then could you explain me what I'm doing wrong here:
file VeryLongName.c :
-----------
#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("%s\n", argv[0]);
        return 0;
}
----------
file test.c:
----------
#include <stdlib.h>

int main(void)
{
   system("VeryLongName.exe");
   return 0;
}
----------

When I call test, I see:
c:/djgpp/programs/djgpp/verylong.exe
and not
c:/djgpp/programs/djgpp/VeryLongName.exe

What I'm doing wrong here?

Laurynas Biveinis

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019