[erlang-questions] erlang-questions Digest, Vol 24, Issue 40

John Haugeland stonecypher@REDACTED
Mon May 11 18:17:05 CEST 2009

> Hi all,
> Just wanted to let you know that I found out what was preventing
> erl_interface from working on windows! :)
> The solution had already been shared on the mailing lists:
>    http://erlang.org/pipermail/erlang-questions/2004-April/012097.html
>    http://www.erlang.org/ml-archive/erlang-questions/200305/msg00259.html
> It's just a matter of setting stdin/out to binary mode and voil?: working code!

I wish I'd realized this was a problem; I blogged about this a while
back.  If I'd realized it was an issue I would have spoken up sooner.

Serge's implementation isn't quite correct on a fine detail about the
way Microsoft implements vendor namespacing.  That's the compatability
mode wrapper, which is discarded if certain unicode preprocessor
defines are used.  The correct answer is this very similar looking

_setmode( _fileno( stdin ) , _O_BINARY );
_setmode( _fileno( stdout ), _O_BINARY );

This was found at http://fullof.bs/ha-ha-_read-and-_write-arent-binary
.  There are also instructions there for unhosted gcc-derived
toolchains (eg DevKitPro).

  - John

More information about the erlang-questions mailing list