in reply to Print log at runtime instead of dumping all at once later

Ok, i'm not a guru in InterProcessCommunication nor i know what a Jenkins jobs is.. but i have some hint for you:



L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: Print log at runtime instead of dumping all at once later.. Net::SSH output buffer
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Print log at runtime instead of dumping all at once later.. Net::SSH output buffer
by salva (Canon) on Jul 02, 2015 at 10:32 UTC
    if i understand $stdout, $errput are filehandle

    No, they are the ouput captured coming from the stdout and stderr streams of the remote process.

      Ah thanks for the clarification salva so they are strings and the method wait the remote command to complete before passing to next instruction? How the stdout_fh => $fh option is inteded to be used? is sufficient a waitpid call to be sure no more infos will came in the buffer? As you can understand i lack a lot of info about the overall schema, but if you have the patience to write some lines i'll be glad.

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        If you check the documentation for the capture2 method, you will see that it doesn't accept a stdout_fh argument.

        capture2 starts the remote command, and captures any output it sends to stdout and stdin until it exits. Under the hood, it also calls waitpid, and the return code from the remote process can be inspected afterwards, just looking at $?.