[Top][All Lists]

[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: Thu, 12 Oct 2006 16:34:54 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

>>>>> "Brian" == Brian May <address@hidden> writes:

    Nathaniel> This is about as efficient as anything you can do.  The
    Nathaniel> parsing bit is somewhat annoying -- unfortunately, I
    Nathaniel> don't think that anyone has actually written a basic_io
    Nathaniel> parser for perl yet.  It's pretty straightforward to do
    Nathaniel> (certainly easier than writing your average library
    Nathaniel> binding ;-)), and if you did it then we could
    Nathaniel> distribute it and no-one would ever have to do it
    Nathaniel> again, but there it is.  A useful thing to look at
    Nathaniel> might be the python module that's part of the new
    Nathaniel> viewmtn that Grahame just posted a link to today -- not
    Nathaniel> perl, but perhaps similar enough in spirit.

    Brian> If I get some spare time I might have a look. I haven't
    Brian> written much python, but I am confident I will be able to
    Brian> read it ;-).

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).

=== cut ===
address@hidden:~/tree/net.angrygoats.viewmtn$ ./testmtn
Name "mtn::standalone::CHILD_STDERR" used only once: possible typo at <rubbish> 
line 19.
Name "mtn::standalone::CHILD_STDOUT" used only once: possible typo at <rubbish> 
line 18.
Cannot close STDOUT pipe: Resource temporarily unavailable at line 61.
Cannot close STDOUT pipe: Resource temporarily unavailable at line 74.
=== cut ===

I replaced the characters under <rubbish> because they messed up
cut&paste under X. The warning is wrong, both values are used twice.

strace of the last warning shows:

=== cut ===
read(3, "\ntestmtn\n", 4096)      = 15
read(3, 0x8173940, 4096)                = -1 EAGAIN (Resource temporarily 
read(3, 0x8173940, 4096)                = -1 EAGAIN (Resource temporarily 
close(3)                                = 0
write(2, "Cannot close STDOUT pipe at mtn."..., 44Cannot close STDOUT pipe at line 61.
) = 44
waitpid(32756, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 32756
--- SIGCHLD (Child exited) @ 0 (0) ---
close(5)                                = 0
write(1, "\ntestmtn\n\n",

)     = 16
close(6)                                = 0
close(4)                                = 0
exit_group(0)                           = ?
Process 32755 detached
=== cut ===

So I think perl is performing a read(...) when I try to close(...) and getting 
that the read(...) failed even though the close(...) succeeded.
Brian May <address@hidden>

Attachment: testmtn
Description: Text Data

Description: Text Data

reply via email to

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