[Issue 1250] New: std.stream.BufferedFile should have a destructor with close()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 28 01:46:54 PDT 2007


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

           Summary: std.stream.BufferedFile should have a destructor with
                    close()
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: wbaxter at gmail.com


std.stream.BufferedFile should have a destructor that calls close().
std.stream.File has one, but std.stream.BufferedFile does not.
It means not all the data will get written to disk with the usage pattern:
{
  scope f = new BufferedFile(filename,FileMode.Out);
  // do a bunch of writes
  // hope f gets closed by RAII magic (it won't)
}


-- 



More information about the Digitalmars-d-bugs mailing list