There seems to exist an issue with (output) redirection, when I try to run an external…
Hans-Peter Diettrich wroteDoes there exist a simple way to run "diff", and to redirect its output into an file? A batch file? Platform independence would be nice, of course.
Execute diff with the two parameters via TProcess. Read the output as normal, and simply write that output to a text file using TFileStream, TStringList etc..
eg:
p := TProcess.Create(nil);
p.Options := [poUsePipes, poStdErrToOutPut];
....
p.Execute
...
SetLength(Buf,BufSize);
repeat
if (p.Outputnil) then
begin
Count:=p.Output.Read(Buf[1],Length(Buf));
// add Buf to a TFileStream, TStringList etc.
...
until Count=0;