On Sun, Mar 11, 2012 at 3:58 AM, Alexander Lamaison <swish_at_lammy.co.uk>wrote:
> On 11 March 2012 06:22, Mitchell Hashimoto <mitchell.hashimoto_at_gmail.com>
> > I'm executing a remote program that sends output to both stdout/stderr.
> > there a way in libssh2 to receive the output in the order it arrived,
> > than as one giant buffer on stdout, then another on stderr, since this is
> > causing out of order results.
> That's always going to be a problem, even when you execute the program
> locally. stdout is buffered and stderr isn't so they don't stay in
> sync. See http://www.pixelbeat.org/programming/stdio_buffering/ for
> more. But this is a general unix process issue, nothing to do with
Certainly, but you can maintain a certain order by doing the equivalent
fsync()s with the streams.
The main issue I see is that you can only ask for a buffer of data from a
stream, where it would be nice to ask "give me all of this stream ID until
another stream data packet was seen." Of course this wouldn't _guarantee_
order but it would be more correct.
> Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-03-11