[fpc-pascal] TProcess questions

Adrian Maier adrian.maier at gmail.com
Tue Oct 3 09:17:11 CEST 2006


Hello,

I have several questions about executing external programs with TProcess

1.  I need to execute the following command :
  psql -q -f /home/am/src/gfaf/hlemit_d.sql  -v D1="'1-apr-06'" -v
D2="'1-jun-06'"

(it might not be obvious at first sight that there are both "  and  '
enclosing those dates , because the argument must contain the '  ) .

This command works fine when executed from the bash shell.  However, it
no longer works when executed from my pascal program (with TProcess).
Any idea how should i quote the arguments so that they would be properly
treated by TProcess?

2.  Where is the TProcess documented on the freepascal website? I had
found a FCL.pdf  some time ago , but I am unable to find that doc on the
freepascal website.

3.  The code returned by the called program can be got with
TProcess.ExitCode , right ?   I have a situation in which a program  1
, but  TProcess.ExitCode is 0.   Therefore it's impossible to detect
the failure.


Cheers,
Adrian Maier



More information about the fpc-pascal mailing list