monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] ikiwiki and monotone


From: Brian May
Subject: Re: [Monotone-devel] ikiwiki and monotone
Date: Fri, 13 Oct 2006 10:02:05 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

>>>>> "Zack" == Zack Weinberg <address@hidden> writes:

    Zack> On 10/11/06, Brian May <address@hidden> wrote:
    >> Here is my first attempt, and a simple test script, for my
    >> version of the stand-alone run function. Attached.
    >> 
    >> I don't like it. Not only does perl give a number of invalid
    >> warnings, but it also seems very large and complicated.
    >> 
    >> Unfortunately, to the best of my knowledge, perl does not have
    >> any high level API for receiving STDOUT and STDERR as separate
    >> streams from a child process (unlike what seems possible in
    >> Python).

    Zack> I believe you want IPC::Open3.  I don't remember enough Perl
    Zack> to help you with the rest, though.

Unfortunately, open3 (which I believe is the same thing as IPC::Open3)
has several limitations that annoy me:

* Not possible to execute program (AFAIK) without executing shell and
having it parse the command line parameters (unlike exec and shell
which will take an array and call exec with that array directly).

* From the documentation (man perlipc):

If you really want to, you can use the standard open2() library
function to catch both ends.  There's also an open3() for
tridirectional I/O so you can also catch your child's STDERR, but
doing so would then require an awkward select() loop and wouldn't
allow you to use normal Perl input operations.

The select statement (and corresponding code) is a large part of the
complexity I encountered.

If you don't use a select statement, you risk deadlock (e.g. trying to
read stdin when the child program is trying to flush its stderr
buffers).
-- 
Brian May <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]