digitalmars.D.bugs - [Issue 15330] New: std.file.copy outputs wrong error message when
- via Digitalmars-d-bugs (32/32) Nov 13 2015 https://issues.dlang.org/show_bug.cgi?id=15330
https://issues.dlang.org/show_bug.cgi?id=15330 Issue ID: 15330 Summary: std.file.copy outputs wrong error message when target directory doesn't exist Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: lbach rocketmail.com The following program works as expected because both the source file and the destination directory exist: import std.file; void main() { copy("/home/master/temp/foo.txt", "/home/master/foo.txt"); } Changing the second argument to this: import std.file; void main() { copy("/home/master/temp/foo.txt", "/home/master/baz/foo.txt"); } causes the program to fail because there is no /home/master/baz directory. But the error message is std.file.FileException std/file.d(2315): /home/master/temp/foo.txt: No such file or directory That's confusing because the file does exist. The correct message would be std.file.FileException std/file.d(2315): /home/master/temp: No such directory --
Nov 13 2015