D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4188 - std.file.remove throws Exception on success
Summary: std.file.remove throws Exception on success
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Shin Fujishiro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 16:46 UTC by Jesse Phillips
Modified: 2014-02-15 02:46 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jesse Phillips 2010-05-14 16:46:02 UTC
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 Shin Fujishiro 2010-05-26 07:23:37 UTC
Fixed in svn r1560.
Comment 2 Brad Roberts 2010-06-17 18:26:02 UTC
*** Issue 4187 has been marked as a duplicate of this issue. ***