January 13, 2016 [Issue 4243] [snn.lib] setmode doesn't set stdin/stdout to binary | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4243 Johan Engelen <goejendaagh@zonnet.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |goejendaagh@zonnet.nl --- Comment #1 from Johan Engelen <goejendaagh@zonnet.nl> --- On Windows, with DMD, the following code works to set stdout to binary mode: version(Windows) { // See Phobos' stdio.File.rawWrite { import std.stdio; immutable fd = fileno(stdout.getFP()); setmode(fd, _O_BINARY); version(CRuntime_DigitalMars) { import core.atomic : atomicOp; atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT); } } } Note the extra CRuntime_DigitalMars bit. -- | ||||
March 17, 2021 [Issue 4243] [snn.lib] setmode doesn't set stdin/stdout to binary | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4243 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |WORKSFORME --- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> --- I cannot reproduce the initial example (and it doesn't look like it has anything to do with the dmd component, but rather with phobos) and an working alternative has been proposed. Closing as WORKSFORME. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply