Bug 4188 – std.file.remove throws Exception on success

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-05-14T16:46:00Z
Last change time
2014-02-15T02:46:04Z
Assigned to
rsinfu
Creator
Jesse.K.Phillips+D

Comments

Comment #0 by Jesse.K.Phillips+D — 2010-05-14T16:46:02Z
Using remove on a file that does not exist will result in a exception that is not clear what the issue is, example below: import std.file; void main() { remove("IDontExist.txt"); } std.file.FileException: In std\file.d(400), data file IDontExist.txt: The operation completed successfully. The FileException states the "operation completed successfully" this is not actually the case since there was nothing to remove. Even though it had nothing to remove I think it is reasonable to consider the operation successful at which point it shouldn't be throwing an Exception.
Comment #1 by rsinfu — 2010-05-26T07:23:37Z
Fixed in svn r1560.
Comment #2 by braddr — 2010-06-17T18:26:02Z
*** Issue 4187 has been marked as a duplicate of this issue. ***