Skip to content
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

cp: adapt error message if destination directory doesn't exist #5541

Closed
wants to merge 1 commit into from

Conversation

cakebaker
Copy link
Contributor

When trying to copy a file to a non-existing directory, uutils cp currently shows the following error:

$ cargo run cp a.txt no-such/
cp: 'a.txt' -> 'no-such/': Is a directory (os error 21)

GNU cp, on the other hand, shows the following error:

$ cp a.txt no-such/
cp: cannot create regular file 'no-such/': Not a directory

This PR adapts the error message to match the one from GNU cp.

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/tail/symlink is no longer failing!

@tertsdiepraam
Copy link
Member

tertsdiepraam commented Nov 15, 2023

Do you know why this check for the separator does not show up anywhere else in the code? Surely there's some place where we have to check for that so that we can interpret this correctly as copying to a directory or is that not implemented?

I think we might be missing something somewhere else that is causing the different message...

@sylvestre
Copy link
Contributor

@cakebaker ping?

@cakebaker
Copy link
Contributor Author

I don't know why there isn't such a check for the separator.

@cakebaker
Copy link
Contributor Author

Closing this PR, it has been fixed in a different way in #5780

@cakebaker cakebaker closed this Jan 7, 2024
@cakebaker cakebaker deleted the cp_trailing_slash branch January 7, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants