[Issue 19834] New: File exception for [std.file.copy] on windows shows the target file rather than the source file

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 27 14:00:34 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19834

          Issue ID: 19834
           Summary: File exception for [std.file.copy] on windows shows
                    the target file rather than the source file
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/phobos/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: lyncmi07 at yahoo.co.uk

When attempting to copy from a file that does not exist:
copy("idontexist.txt", "target.txt");

I get the following file exception:
std.file.FileException at std\file.d(4230): target.txt: The system cannot find the
file specified.
This happens regardless of whether the target file exists or not.

This similarly happens when attempting to copy a file you do not have
permissions to:
copy("nopermission.txt", "target.txt");
throws the exception:
std.file.FileException at std\file.d(4230): target.txt: Access is denied.

I tried this on posix (macosx) and the file displayed in the exception was the
source file as expected.

--


More information about the Digitalmars-d-bugs mailing list