Skip to content

cp: "cannot overwrite non-directory" errors differ from GNU #15000

Description

@abendrothj

When a recursive copy meets a non-directory where it needs a directory, the error differs from GNU (uutils at 5f3aa7b, GNU 9.12 built from source):

setup command GNU uutils
dst is a file cp -r src dst cannot overwrite non-directory 'dst' with directory 'src' cannot overwrite non-directory with directory
src/sub is a directory, d/sub a file cp -r src/. d cannot overwrite non-directory 'd/./sub' with directory 'src/./sub' cannot create regular file 'd/sub/x': Not a directory

Both fail and leave the file untouched; only the message differs. uutils drops the names in the first case and reports a later step in the second.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions