[fpc-pascal] Linux - ExecuteProcess versus fpSystem

brian brian at meadows.pair.com
Fri Sep 9 12:00:21 CEST 2011


On 09/09/2011 04:02 AM, Felipe Monteiro de Carvalho wrote:
> The quotes are bash commands, they are not part of command line. I
> wrote on this topic not long ago, but for TProcess:
>
> http://wiki.lazarus.freepascal.org/Executing_External_Programs#Parameters_which_contain_spaces_.28Replacing_Shell_Quotes.29
>

OK, I've read your notes for TProcess, I'll give that a try. Thanks.

I have to say that when you have two overloaded declarations for 
ExecuteProcess, one with an array of parameters and one with a single 
parameter string, it's not clear to me why you then break the single 
string into individual parameters, but I'm sure there's some good 
reason for it. Maybe that single parameter string form of the command 
should be deprecated. I certainly think that the documentation is 
directly misleading :-

<paste>

In case ComLine is a single string, it will be split out in an array 
of strings, taking into account common whitespace and quote rules.

</paste>

At least IMHO, having to quote the entire parameter string, not just 
the value, is anything but "common whitespace and quote rules".

However, thanks again for the assistance, folks. You can be sure this 
one has been carefully noted - the idea of needing to wrap parameter 
AND value in quotes wouldn't have occurred to me in a month of Sundays.


Brian.



More information about the fpc-pascal mailing list