Message2682

Author pmezard
Recipients junkblocker, lch, shamilbi
Date 2007-01-09.07:25:45
Content
> If Mercurial were written in C, the most straightforward solution would be 
> to use _setmode() to manage the text/binary mode of stdout.  Like so:
> _setmode(_fileno(stdin), _O_BINARY);
> // print lines of diff
> _setmode(_fileno(stdin), _O_TEXT);

Thank you Lee, I did not know that, you just saved my day.

You can do that in lovely python also, setmode() is available through the msvcrt
module and it works fine on stdio streams.
History
Date User Action Args
2007-01-09 07:25:47pmezardsetmessageid: <1168327547.42.0.232652752501.issue250@selenic.com>
2007-01-09 07:25:47pmezardsetrecipients: + junkblocker, shamilbi, lch
2007-01-09 07:25:47pmezardlinkissue250 messages
2007-01-09 07:25:45pmezardcreate