Skip to content

Non regular files break cp even if they are excluded #775

@MqllR

Description

@MqllR

If a non-regular file exists in a directory and we try to cp, s5cmd will exit with an error. This is true even if we exclude that non-regular file.

Example:

ls -la /tmp/test/
total 172
drwxrwxr-x  4 mql  mql    4096 Dec 10 14:01 .
drwxrwxrwt 26 root root 159744 Dec 10 14:02 ..
drwx------  5 mql  root   4096 Dec 10 14:01 geth
srw-------  1 mql  root      0 Dec 10 14:01 geth.ipc
drwx------  2 mql  root   4096 Dec 10 14:01 keystore

Then cp:

s5cmd cp --exclude "*.ipc" /tmp/test/ s3://mybucket/
ERROR "cp --exclude=*.ipc /tmp/test/ s3://mybucket/": object '/tmp/test/geth.ipc' is not a regular file
cp ...

Expected behavior is that s5cmd won't consider this unix socket file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions