Mail Archives: djgpp/1999/09/16/12:40:41
On Thu, 16 Sep 1999 09:01:35 -0700, Klaus Reinhardt
<K DOT Rdt AT TU-Berlin DOT DE> wrote:
> ----------------- mailto:K DOT Rdt AT TU-Berlin DOT DE start -------------------
> Hello!
>
> It's a Pascal(fpc)-program, but perhaps someone from this group could
> help.
>
> exec('c:\g32\bin\ls.exe',' -l y > log');
> gives:
> c:/g32/bin/ls: >: No such file or directory (ENOENT)
This is neither a C problem nor a Pascal problem but a problem of
interfacing DOS.
EXEC is a wrapper for the DOS EXEC function which executes the program
_instead_ of COMMAND.COM. Redirection is a service of the command
processor. EXEC expects the parameters to the program and not the
parameters to COMMAND.COM. You would have to call the program via the
command processor.
exec(getenv('COMSPEC'), '/c c:\g32\bin\ls.exe -l y > log');
Regards
Horst
- Raw text -