www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20590] New: Files with NUL bytes in them are incorrectly

https://issues.dlang.org/show_bug.cgi?id=20590

          Issue ID: 20590
           Summary: Files with NUL bytes in them are incorrectly accepted
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: elronnd elronnd.net

Sample code:

import std.stdio;                                                               
import std.file: readText;

void main() {
        writeln(readText("foo.txt\0blah"));
}

The file 'foo.txt\0blah' /can't/ exist on unix (idk about windows), but foo.txt
exists and is read.

--
Feb 20