[Lazarus] TProcess not mirroring terminal
Michael Van Canneyt
michael at freepascal.org
Tue Jun 2 15:19:12 CEST 2015
On Tue, 2 Jun 2015, JuuS wrote:
> On 06/02/2015 02:31 PM, Michael Van Canneyt wrote:
>> On Tue, 2 Jun 2015, JuuS wrote:
>>> Hi All,
>>> I'm using Lazarus 1.4 with Kubuntu 14.04
>>> I've written a small GUI frontend for the rsync command. I assemble
>>> rsync command line switches and source and destination thru the TProcess
>>> paramlist and everything has been exactly mirrored by my program and
>>> when the exact same command is run through a terminal, it has worked
>>> perfectly for everything I want to do with rsync...
>>> ...until today.
>>> For the first time my output and the output from the same command line
>>> run in terminal work differently.
>>> Run it through terminal and the command is accepted, however running it
>>> through TProcess and rsync complains! The two outputs are listed below,
>>> the parameters passed are exactly the same.
>>> Anyone have an idea why this is so???
>> As a wild guess: You cannot specify * or ** (or any wildcard), because
>> that must be escaped using the shell.
> Thanks for the answer. wildcards do work fine when I make exclude and
> include params, but then those are interpreted by rsync as simple
> patterns to match. So you are saying that in the case of the actual
> source folder param the shell must be involved and passing it through
> TProcess params won't work?
If you type the command on the command-line, then the shell will have interpreted them.
rsync will not see them.
> I can live with this, but it would be nice for it work. Any way to
> tickle the shell in some way through TProcess??
You can simply execute the shell and use its -c option to pass the rsync command with all options.
More information about the Lazarus