in reply to STDOUT buffering problem

Are you sure you need '\r' not '\n' ?

Are you just looking at the output on screen and the '\r' (return) is just over writing the last line whereas '\n' (newline) will put the output on a newline ?

Replies are listed 'Best First'.
Re^2: STDOUT buffering problem
by illtud (Initiate) on Apr 16, 2013 at 13:17 UTC

    Thanks for the replies.

    No, I'm looking at the output in a binary editor, and \r is definitely what I need, not \n (this is a printer control language and it wants \r). The writes are definitely coming out in an unexpected order. I'm also piping these straight into a file and getting the same results.