[Lazarus] send complex command to linux
ugaciaka
ugaciaka at gmail.com
Sat Dec 18 19:49:07 CET 2010
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';
AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
AProcess.Execute;
AStringList.LoadFromStream(AProcess.Output);
AStringList.SaveToFile('output.txt');
end;
AStringList.Free;
AProcess.Free;
end;
====================================================================
but not function, *but* if I write
AProcess.CommandLine := 'firefox gmail.google.com';
my process running correctly firefox.
In first case output.exe is similar to only ouput "lame".
Any resolution?
tnx
ugaciaka
More information about the Lazarus
mailing list