# Naming tips for popen4-style library?

**URL:** https://rubytalk.org/t/naming-tips-for-popen4-style-library/16964
**Category:** ruby-talk
**Created:** [15 March 2005 16:47 UTC](https://rubytalk.org/t/naming-tips-for-popen4-style-library/16964 "2005-03-15T16:47:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Berger\_Daniel1](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@Berger\_Daniel1](https://rubytalk.org/u/Berger_Daniel1)
#### Post date: [15 March 2005 16:47 UTC](https://rubytalk.org/t/naming-tips-for-popen4-style-library/16964/1 "2005-03-15T16:47:48Z")

</div>

Ara Howard had brought up an Open4 back in [http://rubyurl.com/Pq1hj\](http://rubyurl.com/Pq1hj%5C). I  
mention this because the win32-open3 package already has an Open4 module  
that uses Ara's API approach (i.e. returns a pid as a 4th argument).

If folks want to change things, that's fine. But the Ruby community  
should try to come to a consensus as to what the API should look like  
and how it should behave.

Regards,

Dan

> **···**
>
> > -----Original Message-----  
> > From: Jonathan Paisley [mailto:jp-www@dcs.gla.ac.uk]  
> > Sent: Tuesday, March 15, 2005 9:32 AM  
> > To: ruby-talk ML  
> > Subject: Naming tips for popen4-style library?
> > 
> > Hello,
> > 
> > I've been developing a library for communicating with sub  
> > processes via  
> > pipes, which is modelled somewhat after Python's Popen4 class [1]  
> > (although the semantics are slightly different).

---

<div class="post-metadata">

### Author: ![Jonathan\_Paisley](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@Jonathan\_Paisley](https://rubytalk.org/u/Jonathan_Paisley)
#### Post date: [15 March 2005 17:07 UTC](https://rubytalk.org/t/naming-tips-for-popen4-style-library/16964/2 "2005-03-15T17:07:11Z")

</div>

> Ara Howard had brought up an Open4 back in [http://rubyurl.com/Pq1hj\](http://rubyurl.com/Pq1hj%5C). I  
> mention this because the win32-open3 package already has an Open4 module  
> that uses Ara's API approach (i.e. returns a pid as a 4th argument).

Yes, I should have mentioned Ara's Open4. I had been talking to Ara about the possibility of merging our two approaches (possibly providing the procedural interface on top of the object-oriented one).

> If folks want to change things, that's fine. But the Ruby community  
> should try to come to a consensus as to what the API should look like  
> and how it should behave.

Good point.

In my implementation, I've avoided the double-fork technique because I want the child to keep its association with the parent, in particular to support sending signals and waiting on the child to complete.

Since the library manages a list of children it is able to reap them at opportune moments.

So, I'd argue for providing both the procedural and object-oriented approach, with the former built upon the latter. Of course, the API would have to cover the functionality present on unix and win32.

I'm not so keen on the Open4 name - I'd prefer something like ChildProcess.

In summary - can we come up with a consensus as to what the API should look like and what its behaviour should be? (w.r.t. double forks, waiting, etc).

Thanks.  
Jonathan

> **···**
>
> On 15 Mar 2005, at 16:47, Berger, Daniel wrote:
