On 16 July 2011 22:37, Hans-Peter Diettrich <drdiettri...@aol.com> wrote: > > Does 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.Output<>nil) then begin Count:=p.Output.Read(Buf[1],Length(Buf)); // add Buf to a TFileStream, TStringList etc. ... until Count=0; -- Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel