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

Davide Marquês nesrait@REDACTED
Tue May 12 01:49:52 CEST 2009


Ahoy! :)

>> 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.

Thanks anyway! Unfortunately, from the few symptoms I'd encountered it would
be hard to tell where the problem lied. :\

The best we(=someone with write access to the documention), can do to prevent
this from happening (to the next newbie) is to seek out and update all
erl_interface
code examples (starting with the tutorial) so that it warns (in one of
those big red
boxes) about these port/windows issues. ;)

> 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
> code:
>
> _setmode( _fileno( stdin ) , _O_BINARY );
> _setmode( _fileno( stdout ), _O_BINARY );
I think VC++ complains about this because I just looked at my code and
it already looked like this. :)

> 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

Cheers,
:Davide



More information about the erlang-questions mailing list