[lazarus] TProcess parameters...

Marc Weustink marc at dommelstein.net
Sat Jun 21 18:22:51 EDT 2003


At 16:37 21-6-2003 -0600, Tom Lisjac wrote:

>TProcess has been working great, but I've run into a parameter passing
>issue that I haven't been able to resolve:
>
>Setup:
>Options:=[poUsePipes,poNoConsole];
>ApplicationName:='';
>CurrentDirectory:='';
>
>The following works fine and returns the full directory listing via
>standard out:
>
>CommandLine:='ls /mnt/disk/redhat9/release';
>
>The same line fails when an ambiguous file qualifier is added. The ls
>command returns a "file not found" in standard error. There are 1400+
>rpm's in the directory.
>
>CommandLine:='ls /mnt/disk/redhat9/release/*.rpm';


A first shot here. When you issue ls *.rpm from a shell, the * is expanded 
by your shell and it is'nt passed to ls. ls get (in your case) all 1400 
files as argument.

What you are excuting is something like ls "*.rpm" and that file does not 
exist.

>I've looked at the TProcess code and can't seem to find any problems
>there. CommandToList and MakeCommand both seem to return the expected
>results. I've concluded the problem may be in CreateProcess... but I
>can't seem to run it down.
>Any suggestions would be appreciated! :)

Hope it helped.

Marc







More information about the Lazarus mailing list