Board index » kylix » Capture output from a command-line program

Capture output from a command-line program


2005-07-24 12:23:24 AM
kylix2
I would like to run a command-line program from a Kylix GUI
application and display the output of the command-line program in a
TMemo in the GUI application. What is the best way to capture the
output from the command-line program?
 
 

Re:Capture output from a command-line program

rbwinston wrote:
Quote
What is the best way to capture the output from the
command-line program?
The Libc.popen() function is the easiest way but has it's limits.
A more complex but also more powerfull method is to fork(), pipe() and
execXx().
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Capture output from a command-line program

rbwinston wrote:
Quote
I would like to run a command-line program from a Kylix GUI
application and display the output of the command-line program in a
TMemo in the GUI application. What is the best way to capture the
output from the command-line program?
See the Execute function in JclSysUtils.pas from the JCL library here:
sourceforge.net/projects/jcl/
Regards,
Wayne Sherman
Las Vegas
 

{smallsort}

Re:Capture output from a command-line program

rbwinston schrieb:
Quote
I would like to run a command-line program from a Kylix GUI
application and display the output of the command-line program in a
TMemo in the GUI application. What is the best way to capture the
output from the command-line program?
Unix utilities from:
www.tempest-sw.com/freeware/freeware.cgi?kylix
 

Re:Capture output from a command-line program

Thanks Andreas, Wayne, and theo for the suggestions.
theo < XXXX@XXXXX.COM >wrote:
Quote
rbwinston schrieb:
>I would like to run a command-line program from a Kylix GUI
>application and display the output of the command-line program in a
>TMemo in the GUI application. What is the best way to capture the
>output from the command-line program?

Unix utilities from:
www.tempest-sw.com/freeware/freeware.cgi?kylix