[Issue 3424] New: Ref counting still doesn't work for std.stdio.File

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 20 09:22:30 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3424

           Summary: Ref counting still doesn't work for std.stdio.File
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2009-10-20 09:22:29 PDT ---
If this can't be fixed in short order it should at least be documented so that
people don't rely on the ref counting and auto closing.  Here's a test case to
show it doesn't work.  This fails on both Windows and Linux.

import std.stdio, std.file;

void main() {
    std.file.write("foo.txt", "stuff");
    foreach(i; 0..1_000_000) {
        openStuff();  // Throws too many files error rather quickly.
    }
}

void openStuff() {
    File myFile = File("foo.txt");
    // Not automatically closed.
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list