Recent

Author Topic: Ways to execute external program/process  (Read 11501 times)

mvampire

  • Jr. Member
  • **
  • Posts: 62
Ways to execute external program/process
« on: September 09, 2010, 05:32:07 pm »
Hello. I'm interested to know all ways, how to execute external process in Unix...

I've found 6 ways:
1) TProcess (http://wiki.freepascal.org/Executing_External_Programs)
2) SysUtils.ExecuteProcess (http://wiki.freepascal.org/Executing_External_Programs)
3) fpsystem (http://wiki.freepascal.org/Console_Mode_Pascal#Execute_shell_command)
4) POpen (http://www.freepascal.org/docs-html/rtl/unix/popen.html)
5) Shell (http://www.freepascal.org/docs-html/rtl/unix/shell.html)
6) FpExecve (http://www.freepascal.org/docs-html/rtl/baseunix/fpexecve.html)

I also want to manage output of the executed process but with TProcess my program hangs with large output... And I don't like the way offered in http://wiki.freepascal.org/Executing_External_Programs.
« Last Edit: September 10, 2010, 09:33:31 pm by mvampire »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: Ways to execute external program/process
« Reply #1 on: September 10, 2010, 06:44:50 pm »
Hello. I'm interested to know all ways, how to execute external process in Unix...

Till now I've found only 3:
1) TProcess (http://wiki.freepascal.org/Executing_External_Programs)

2) SysUtils.ExecuteProcess (http://wiki.freepascal.org/Executing_External_Programs)
3) fpsystem (http://wiki.freepascal.org/Console_Mode_Pascal#Execute_shell_command)

I also want to manage output of the executed process but with TProcess my program hangs with large output... And I don't like the way offered in http://wiki.freepascal.org/Executing_External_Programs.

Use tprocess, it should work. If there is a problem, create a reproducable situation and file a bug.

mvampire

  • Jr. Member
  • **
  • Posts: 62
Re: Ways to execute external program/process
« Reply #2 on: September 10, 2010, 09:29:23 pm »
Ok, thanks.
I've anyway found several more ways - I'll add them now to the first post.

 

TinyPortal © 2005-2018