An easy phobos i/o bug to fix

starcanopy starcanopy at protonmail.com
Wed Jul 29 03:15:02 UTC 2020


On Wednesday, 29 July 2020 at 03:08:43 UTC, starcanopy wrote:
> Looks like the contents of the Windows' version needs to be put 
> into an if statement if I'm correctly following you.
>
> version (Windows)
> {
>     import std.algorithm: canFind;
>
>     /* currMode is a member of File
>     I'd imagine, unless the value being assigned to currMode is 
> normalized, canFind or something similar would be preferable 
> over exhaustive checking. */
>     if (!currMode.canFind("b"))
>     {
>         // current behavior
>     }
> }
>
> // write

You could also just have a boolean member, e.g. binaryMode, 
present in only the Windows compilation that is true iff the mode 
in which the file was opened specified a binary mode.


More information about the Digitalmars-d mailing list