stdout in binary mode

Steven Schveighoffer schveiguy at yahoo.com
Thu Jul 4 04:59:16 PDT 2013


On Wed, 03 Jul 2013 20:20:17 -0400, bearophile <bearophileHUGS at lycos.com>  
wrote:

> How do you open stdout in binary mode with D/Phobos?

Same way you would do it in C.  D uses C's FILE * as it's implementation.

> In C++ you use something like:
>
> setmode(fileno(stdout), O_BINARY);
>
> (I don't even know where to find O_BINARY in core.stdc).

It may not be present, but it's just a number.  Look it up.

-Steve


More information about the Digitalmars-d-learn mailing list