[fpc-devel] TProcess and arguments with quotes

Marco van de Voort marcov at stack.nl
Wed Sep 5 12:03:46 CEST 2012


In our previous episode, Martin said:
> > function RunCommand(const cmdline:string;var 
> > outputstring:string):boolean; deprecated;
> 
> Sorry seen to late, it is deprecated...
> 
> Seems that FPC is missing the functionality for "commandline" (which is 
> a property that existed for very long). Seen that it is now deprecated 
> probably means there are no plans to implement it?

Nope. Actually issues like this were the reason to deprecate it. There
barely has been a FPC version without changes to the quoting, and every
usage could possibly break something else again.

Users also seemed to be unable to handle the difference between api and
shell, which also caused constant confusion.

> > concatenate arguments (and thus split them again). So in time it is 
> > urgently recommended to follow that.
> 
> does not explain the lack of a working command line property. For code 
> that has already individual params, the new Parameters[] property could 
> live together with a fully implemented commandline.

Define fully. What do you do when stuff conflicts between platforms?

How many escapes is still reasonable?

Moreover, if this is a crucial interface, how do you make sure it is stable
in every release? Actually the debugger interface in Lazarus and its
critical importance was one of the reasons behind this alternate course.

For code as critical as the debugger interface in Lazarus you might want to
do your own parsing and then pass it to the mostly invariant (and thus
hopefully stable) arguments like interface of FPC.

But of course more logical is to eliminate the dangerous parsing entirely.
 
> Assuming, that there are many apps that have a single string, IMHO it 
> would be a good idea to add this functionality in fpc.

Nothing has been removed. It only has been deprecated.  



More information about the fpc-devel mailing list