Re: stdout in binary mode

2013-07-04 Thread bearophile
Mike Parker: setmode() should be in unistd.h, but I can't import core.stdc.unistd (and I don't find it in std.c.windows.windows). core.sys.posix.unistd I have tried this on Windows32, and it doesn't find much: import core.sys.posix.unistd: setmode; import core.sys.posix.stdio: fileno; impo

Re: stdout in binary mode

2013-07-04 Thread Mike Parker
On Thursday, 4 July 2013 at 12:28:07 UTC, bearophile wrote: Steven Schveighoffer: setmode() should be in unistd.h, but I can't import core.stdc.unistd (and I don't find it in std.c.windows.windows). core.sys.posix.unistd setmode isn't actually standard C nor of the Posix standard. It's

Re: stdout in binary mode

2013-07-04 Thread bearophile
Steven Schveighoffer: 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. Adding a hardcoded magic number in my code isn't very good. setmode() should be in u

Re: stdout in binary mode

2013-07-04 Thread Steven Schveighoffer
On Wed, 03 Jul 2013 20:20:17 -0400, bearophile 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 kno

stdout in binary mode

2013-07-03 Thread bearophile
How do you open stdout in binary mode with D/Phobos? In C++ you use something like: setmode(fileno(stdout), O_BINARY); (I don't even know where to find O_BINARY in core.stdc). Bye and thank you, bearophile