-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check isdir(dest) and copy into that directory in cp and friends? #26423
Comments
Adding triage since this changes behavior and probably needs to be decided before 1.0. |
What do other languages do? I would think it's reasonable to be stricter in a programming language than in the shell, which allows catching potential mistakes. |
Just noting also that the current behaviour is not very useful; it is unlikely that you want to replace a folder with a file (which is the result of setting cp("src", joinpath(dir, "src")) is not very nice. |
Would |
I think changing this would be worse in terms of orthogonality --- if you actually want the logic "if this is a directory then copy into it", then you should write that. Conditional behavior should not be built into the library function itself. |
This use-case would have to come up a lot to put this specific functionality in to Base. Grepping Julia packages for uses of |
Should we check if
"dest"
is a directory, and if so, copy"src"
to that directory?Compare e.g. with
The text was updated successfully, but these errors were encountered: