[Lazarus] send complex command to linux

Henry Vermaak henry.vermaak at gmail.com
Sat Dec 18 19:58:04 CET 2010


On 18 December 2010 18:49, ugaciaka <ugaciaka at gmail.com> wrote:
> Hi,
>
> this is an example of what I do
> ===================================================
>
> procedure TfrmMain.btnConvertClick(Sender: TObject);
> var
>  enumFile : TStringsEnumerator;
>  AProcess: TProcess;
>  AStringList: TStringList;
> begin
>  enumFile := clbFile.Items.GetEnumerator;
>  AProcess := TProcess.Create(nil);
>  AStringList := TStringList.Create;
>
>  while enumFile.MoveNext do
>  begin
>    AProcess.CommandLine := 'flac -cd /home/ugaciaka/prova/prova.flac
> + | lame -h -b 320 - /home/ugaciaka/prova.mp3';

The shell interprets the | operator, and you are not in a shell, so
you have to do it yourself (or call the command through the shell,
e.g. /bin/sh -c "command").

Henry




More information about the Lazarus mailing list