pipe question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

pipe question

Adam Naumowicz
Hi,

Is there a way to launch an external command, feed its input and catch its
output on Unix? AFAIK POpen allows to get hold of the input or output,
but not both - or am I missing something? Of course, one could open a
temporary file to store the command's input or output and then redirect,
but it's not what I need.

Any help appreciated,

Adam
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pipe question

Jonas Maebe-2

On 2 aug 2006, at 17:33, Adam Naumowicz wrote:

> Is there a way to launch an external command, feed its input and  
> catch its output on Unix? AFAIK POpen allows to get hold of the  
> input or output, but not both - or am I missing something? Of  
> course, one could open a temporary file to store the command's  
> input or output and then redirect,
> but it's not what I need.

See http://wiki.lazarus.freepascal.org/index.php/ 
Executing_External_Programs

(in particular the section 'Example of "talking" with aspell process'  
at the bottom)


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pipe question

Adam Naumowicz
On Wed, 2 Aug 2006, Jonas Maebe wrote:

>
> On 2 aug 2006, at 17:33, Adam Naumowicz wrote:
>
>> Is there a way to launch an external command, feed its input and catch its
>> output on Unix? AFAIK POpen allows to get hold of the input or output, but
>> not both - or am I missing something? Of course, one could open a temporary
>> file to store the command's input or output and then redirect,
>> but it's not what I need.
>
> See http://wiki.lazarus.freepascal.org/index.php/Executing_External_Programs
>
> (in particular the section 'Example of "talking" with aspell process' at the
> bottom)

Great, thanks a lot for your response - I'd rather avoid using TProcess,
but I'll take a look at the examples and try to figure out myself the
low-level stuff behind.

Adam
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal