FAQ
Hi,
I propose to add the following line to the documentation of the StdinPipe()
method in os/exec/exec.go:

// The pipe will be closed automatically after Wait sees the command exit.


It's a minor issue, but as I had to search for it in the code to be sure
about it's behaviour, I thought it would be good to let you know about this.

Regards,
Johan

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dave Cheney at May 11, 2013 at 11:29 pm
    This sounds like a surprising request. What did you expect a pipe connected to a process which has exited to do ?


    On 11/05/2013, at 6:51, johan.samyn@gmail.com wrote:

    Hi,
    I propose to add the following line to the documentation of the StdinPipe() method in os/exec/exec.go:

    // The pipe will be closed automatically after Wait sees the command exit.

    It's a minor issue, but as I had to search for it in the code to be sure about it's behaviour, I thought it would be good to let you know about this.

    Regards,
    Johan

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rémy Oudompheng at May 11, 2013 at 11:35 pm

    On 2013/5/12 Dave Cheney wrote:
    This sounds like a surprising request. What did you expect a pipe connected
    to a process which has exited to do ?
    Maybe the pipe could have been passed to a child process?

    Rémy.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Johan Samyn at May 12, 2013 at 9:09 am
    Hi Dave,

    It's not that I expected the pipe to still be able to do something after
    the Wait, as Remy suggested. But it was unclear to me if the correct way
    was that I had to close the pipe myself. The code - afaict - indicates that
    all 3 (out, err and in) are closed automatically when calling Wait(). Only
    the docstring does not explicitely say so for in, while it does for out and
    err. That confused me, that's all. And if I'm confused, maybe others are
    too; so I thought of suggest some clarification. Maybe I just got it wrong,
    I can accept that.

    Strange thing is, in the situation I'm using it, I have to close the in
    pipe explicitely before calling Wait(), or the program hangs. But maybe
    that is because the (non-Go) process I'm connecting to causes that
    behaviour? (The documentation of the tool I'm connecting to also states
    that closing the inpipe is the way to close the connection.)
    Probably I just don't understand enough of such connections.

    Johan

    On Sunday, May 12, 2013 1:29:05 AM UTC+2, Dave Cheney wrote:

    This sounds like a surprising request. What did you expect a pipe
    connected to a process which has exited to do ?



    On 11/05/2013, at 6:51, johan...@gmail.com <javascript:> wrote:

    Hi,
    I propose to add the following line to the documentation of the
    StdinPipe() method in os/exec/exec.go:

    // The pipe will be closed automatically after Wait sees the command exit.


    It's a minor issue, but as I had to search for it in the code to be sure
    about it's behaviour, I thought it would be good to let you know about this.

    Regards,
    Johan

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.


    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedMay 11, '13 at 11:07p
activeMay 12, '13 at 9:09a
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase