[Issue 3862] std.file.copy does not have the same behavior as cp

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Nov 3 13:14:19 PST 2015


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

--- Comment #8 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(In reply to Vladimir Panteleev from comment #6)
> For example, copying a file into the subdirectory if the destination path is
> a directory is something that would, IMO, violate the principle of least
> surprise.

Seriously? The fact that it _doesn't_ violates the principle of least surprise
IMHO. I would never have expected a copy function to require that the target be
a file rather than a directory.

> At this point, it might be too late to change the behavior of std.file.copy at all.

With regards to copying into a sub-directory, it's definitely not too late,
because it's not a breaking change, but it's true that any changes made would
have to be done with care - though I obviously should have gotten to this ages
ago. I keep forgetting about this issue until I have to use std.copy and run
into problems using it.

--


More information about the Digitalmars-d-bugs mailing list