Re: StdOut and StdErr reading...



Il giorno Thu, 7 Aug 2008 01:50:50 -0700 (PDT), lucadentella@xxxxxxxxx ha scritto:
I'm working on a script to automate SFTP operations (using a text-
based sftp client).
My idea is to use the Exec() method to run the client, send commands
via StdIn and receive output via StdOut and StdErr.

The problem is that when I try to read buffers using ReadAll or
AtEndOfStream, those methods are blocking and never ends... for StdOut
I was able to find a condiction (when I read "sftp>" from the buffer)
to end reading, but for StdErr? Is there a way to know how many chars
are in the buffer to use the Read(n) method which is not blocking?

Hello,
I dropped a project I was working on (reading e-mails using vbs as an interface for
netcat) because I had some problems as yours.
Can you confirm I can read a stream before it is closed and while the output is still
being writing?
Thank you.
Giovanni.

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
.



Relevant Pages

  • sftp via proc_open(): where is my prompt ?
    ... Worked flawless until deployed onto newer machines now and guess what, ... the sftp session). ... I read from stdout until I find ... stdout when talking with the sftp client. ...
    (comp.lang.php)
  • Maintaining message boundaries in redirected stdout/stderr
    ... child program's stderr and stdout back to the client. ... get mixed up by the time that they get back to the client. ...
    (comp.unix.programmer)
  • Re: select + stderr
    ... > I have a client - server, but this works only for stdout. ... > file), I get the error message on server side on stderr, but on client ...
    (comp.unix.programmer)
  • Re: select + stderr
    ... What means stdout in the context of a server-client pair? ... >>file), I get the error message on server side on stderr, but on client ...
    (comp.unix.programmer)
  • unix/expect/spawn -> stderr
    ... I spawn a command (sftp) which send to stdout and stderr. ... can expect on the stdout strings. ...
    (comp.lang.tcl)