[lazarus] TProcess parameters...

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jun 21 18:55:59 EDT 2003


On Sun, 22 Jun 2003 01:11:56 +0200 (CEST)
marcov at stack.nl (Marco van de Voort) wrote:

> > > 
> > > 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! :)
> > 
> > CommandLine:='bash -c "ls /mnt/disk/redhat9/release/*.rpm"';
> 
> Don't use bash, (even worse is to hardcode the path to be /bin)
> 
> BSD systems sometimes don't have bash (they have sh as default Bourne
> shell already, which is enough to run standard scripts). And if they do,
> it is somewhere else, not in /bin.
> 
> linux.shell() takes care of this IIRC.

You are right.
But if he really wanted an OS/Distribution independent solution, he would
use FindFirst/Next instead of 'ls'. Probably this is for the theseus
project, which is in fact Linux only. 


Mattias






More information about the Lazarus mailing list