There seems to exist an issue with (output) redirection, when I try to run an external program from code. What I want to achieve is this:

In a Win32 console I can run
>diff -r dir1 dir2 > diff.txt

When I use e.g. Exec('diff', args), diff complains about an excess argument, it works when "> diff.txt" is removed. With other functions I had less luck (ExecuteProcess, CreateProcess...), no output at all.

Now I assume that output redirection is a shell feature, not available in direct invocation of an external program. Right?

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.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to