Bug 1725 – std.stream.BufferedFile.create should use FileMode.OutNew
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-12-11T15:39:00Z
Last change time
2015-06-09T01:14:23Z
Assigned to
bugzilla
Creator
wbaxter
Comments
Comment #0 by wbaxter — 2007-12-11T15:39:59Z
std.stream.BufferedFile.create uses FileMode.Out by default. This means that if you have a big file pre-existing, call create("file") and then write just a little bit to it, then you will still have a big file with just the initial few bytes overwritten. This is almost certainly not what one wants or expect to happen when they call a method named "BufferedFile.create()".