Bug 3417 – std.stdio.File needs size

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-10-18T13:09:00Z
Last change time
2015-06-09T01:26:55Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-10-18T13:09:58Z
the std.stdio.File struct should have a way of getting the file size. If the file is a standard stream or something, some convention like returning -1 could be used. This would be trivial to implement (though I'm not saying this is necessarily the best or most efficient way) by using something like: try { std.file.getSize(this.name); } catch(FileException) { // A stream that isn't a "real" file. return -1; }
Comment #1 by andrei — 2011-01-08T22:59:12Z
Revision 2284