Bug 17228 – File size() can't determine file unsearchable on Windows.

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-02-26T23:37:50Z
Last change time
2024-12-01T16:29:51Z
Keywords
pull, trivial
Assigned to
No Owner
Creator
Sprink
Moved to GitHub: phobos#9712 →

Comments

Comment #0 by sprink.noreply — 2017-02-26T23:37:50Z
The problem is that size() checks to see if the file is unsearchable by calling tell(). But on windows ftell does not have to return a -1, so no exception is thrown when calling tell. https://github.com/dlang/phobos/blob/v2.073.1/std/stdio.d#L2987 https://msdn.microsoft.com/en-us/library/0ys3hc0b.aspx "On devices incapable of seeking (such as terminals and printers), or when stream does not refer to an open file, the return value is undefined."
Comment #1 by dlang-bugzilla — 2017-07-05T18:05:32Z
Comment #2 by dlang-bot — 2019-05-09T16:28:46Z
@CyberShadow updated dlang/phobos pull request #5549 "Fix Issue 17228 - File size() can't determine file unsearchable on Wi…" fixing this issue: - Fix Issue 17228 - File size() can't determine file unsearchable on Windows https://github.com/dlang/phobos/pull/5549
Comment #3 by robert.schadek — 2024-12-01T16:29:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9712 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB