On Sun, 19 Jul 2020, Bo Berglund via fpc-pascal wrote:

On Sun, 19 Jul 2020 08:46:14 +0200 (CEST), Michael Van Canneyt
<mich...@freepascal.org> wrote:

Various RunCommand procedures in process unit:
https://www.freepascal.org/docs-html/current/fcl/process/runcommand.html


But it looks like it hangs around until the started process exits...
How can I set a timeout on the execution (don't want the whole system
to hang if this external program does not exit)?

And if I just want to start a process but not wait for it to exit?

Use TProcess.

https://www.freepascal.org/docs-html/current/fcl/process/tprocess.html

do NOT specify poWaitOnExit in the options, and simply call Execute. It will return at once.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to