Bug 4187 – Error Message for std.file.remove outputting wrong file and line

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

Comments

Comment #0 by Jesse.K.Phillips+D — 2010-05-14T16:41:15Z
Using remove on a file that does not exist will result in a compiler error that 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 exception is return the the file and line number in std.file rather than the line in my code.
Comment #1 by dsimcha — 2010-06-17T18:06:55Z
Ignore my having marked this as resolved. It was by accident.
Comment #2 by braddr — 2010-06-17T18:26:02Z
you were right.. or even better, closing as a dup of another identical ticket. *** This issue has been marked as a duplicate of issue 4188 ***
Comment #3 by Jesse.K.Phillips+D — 2010-06-18T08:47:55Z
This is not an identical ticket to issue 4188, it uses the same example but is reporting on different portions of the message. 4188 is related to the message "The operation completed successfully." This issue is with reporting the incorrect file and line number for the offending code. And it has not been fixed in version 2.047 std.file.FileException: In std\file.d(409), data file IDontExist.txt: The system cannot find the file specified.
Comment #4 by andrej.mitrovich — 2012-12-20T14:45:41Z
I think this is now supposed to be handled by reading the stack trace. Otherwise there are plenty of functions in Phobos which would be candidates of taking __LINE__ and __FILE__, but I'm not sure if it's worth doing that..
Comment #5 by Jesse.K.Phillips+D — 2012-12-20T15:04:08Z
(In reply to comment #4) I think I can agree with that.