Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2000-11

argv[ 0 ] is not assumed to be a full path ?

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

KO Myung-Hun

Hi/2 all.

Tomas, argv[ 0 ] is not assumed to be a full path, really ?

I know, at leat in recent, 0th parameter must be a full path to

executable file. Sure, other argv except 0th need not be a full path.

They are just parameters.

However, if we shouldn't modify argv probably, we should modify

ParamStr to return a full path as 0th parameter.

Of course, the best solution is to modify both argv and ParamStr.

I don't think that FSearch could solve this problem in DOS, because

all executable file are in directory specfied in 'PATH' and current.

I think that in OS/2, DosGetInfoBlocks is the appropriate API, is not ?

For better FPC !!!

from KO Myung-Hun...

Reply by email

Peter Vreman
Show quoted text 5 lines
Hi/2 all. Tomas, argv[ 0 ] is not assumed to be a full path, really I know, at leat in recent, 0th parameter must be a full path to executable file. Sure, other argv except 0th need not be a full path.

argv is for C compatibility and should be the same as argv in C programs.

They are just parameters. However, if we shouldn't modify argv probably, we should modify ParamStr to return a full path as 0th parameter.

true, paramstr(0) should return full path.

Reply by email

Unknown author
to Peter Vreman

To:
From: Peter Vreman
Subject: Re: [fpc-devel]argv[ 0 ] is not assumed to be a full path ? Date sent: Sun, 12 Nov 2000 13:06:29 GMT
Send reply to:

argv is for C compatibility and should be the same as argv in C programs.

BTW, can somebody verify this works correctly for GO32v2, please (I don't have the GO32v2 version installed at the moment)? I'm asking because ParamStr (0) returns the argv value without any modification there currently.

Tomas

Reply by email

Unknown author
to KO Myung-Hun: Hi/2 all. Tomas, argv[ 0 ] is not assumed to be a full path, really ? I know, at leat in…

Date sent: Sun, 12 Nov 2000 21:24:36 +0900
From: KO Myung-Hun
To: FPC mail
Subject: [fpc-devel]argv[ 0 ] is not assumed to be a full path ? Send reply to:

I don't think that FSearch could solve this problem in DOS, because all executable file are in directory specfied in 'PATH' and current.

This should work. How does DOS locate a program specified on the command line:
1) Checks, whether you didn't give the full (or relative) path.
2) Looks in the current directory.
3) Searches throughout directories specified in PATH. I must have a look at it, there might be some DOS function for getting the full executable path as well, which would be easier, of course (_if_ it would be supported under EMX/RSX).

I think that in OS/2, DosGetInfoBlocks is the appropriate API, is not?

Yes, it is.

Tomas

Reply by email