Article View: comp.sys.amiga.tech
Article #11082Re: popen/pclose for 1.3
From: Vidhyanath K. Rao
Date: Sat, 21 Jan 1989 17:00
Date: Sat, 21 Jan 1989 17:00
23 lines
1738 bytes
1738 bytes
In article <442@solaria.csun.edu> ecphssrw@solaria.csun.edu
(Stephen R. Walton) writes:
>Pipes on the Amiga are really much simpler than you think (I think :-) ).
>Just pretend they are files. Then, instead of something like:
> pipe_handle = popen("command", "w");
>you would do
> pipe_handle = fopen("pipe:myfile", "w");
> Execute("command <pipe:myfile", 0L, 0L);
>and voila. You probably want to use mktemp() to generate your pipe
>file name, just to be safe.
There is one feature that you should be aware of (I don't know if this also
occurs in *N*X pipes):
gets() is implemented usually as `Read(Stdin(), sptr, 256L)'
CON: and, I suspect the ConMan pip: will return when a `newline'
is encountered. PIPE: *will not*. This irrelevent for stored files.
But if you use the 1.3 PIPE:, and expect the spawned process to get
its input as you shove it down the line, you have to pad it at the end.
--
It is the man not the method that Nath
solves the problem. vkr@osupyr.mast.ohio-state.edu
-Poincare. (614)-366-9341
Technical Details
Message-ID:
<1200@osupyr.mast.ohio-state.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tank!ncar!mailrus!tut.cis.ohio-state.edu!osupyr.mast.ohio-state.edu!vkrReferences:
<3768@druwy.ATT.COM> <442@solaria.csun.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tank!ncar!mailrus!tut.cis.ohio-state.edu!osupyr.mast.ohio-state.edu!vkr From: vkr@osupyr.mast.ohio-state.edu (Vidhyanath K. Rao) Newsgroups: comp.sys.amiga.tech Subject: Re: popen/pclose for 1.3 Summary: `Feature' in gets() + pipe.device can bite you! Keywords: pipes Message-ID: <1200@osupyr.mast.ohio-state.edu> Date: 21 Jan 89 17:00:11 GMT References: <3768@druwy.ATT.COM> <442@solaria.csun.edu> Reply-To: vkr@osupyr.mast.ohio-state.edu.UUCP (Vidhyanath K. Rao) Distribution: comp Organization: Dept of Math, Ohio St U at Newark, Newark, OH 43055 Lines: 22