Skip to content

command: skip nonregular files#618

Merged
ilkinulas merged 53 commits intopeak:masterfrom
ahmethakanbesel:fix-special-files
Aug 4, 2023
Merged

command: skip nonregular files#618
ilkinulas merged 53 commits intopeak:masterfrom
ahmethakanbesel:fix-special-files

Conversation

@ahmethakanbesel
Copy link
Contributor

@ahmethakanbesel ahmethakanbesel commented Jul 26, 2023

Resolves #498

Changes are made:

  • cp command checks file mode bits before trying to copy. If the file is a special file, cp do not copy that file. It neither returns an error nor prints a message. The copy process continues as usual.
  • As sync uses cp  in the background, it behaves like cp, so it does not sync special files.

Copy link
Contributor

@seruman seruman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not remember if we ever discussed this but what about outputting some warnings to users?

For example; a cp to a single fifo file exits with 0 without any output which kinda indicates like if it would successfully copied;

~/src/github.com/peak/s5cmd fix-special-files*
; file fifoo
fifoo: fifo (named pipe)

~/src/github.com/peak/s5cmd fix-special-files*
; s5cmd cp fifoo s3://some-bucket/selman/test/; echo $?
0

~/src/github.com/peak/s5cmd fix-special-files*
; s5cmd ls 's3://some-bucket/selman/test/*'
ERROR "ls s3://some-bucket/selman/test/*": no object found

What do you think @ilkinulas?

@ahmethakanbesel
Copy link
Contributor Author

ahmethakanbesel commented Aug 1, 2023

I do not remember if we ever discussed this but what about outputting some warnings to users?

For example; a cp to a single fifo file exits with 0 without any output which kinda indicates like if it would successfully copied;

~/src/github.com/peak/s5cmd fix-special-files*
; file fifoo
fifoo: fifo (named pipe)

~/src/github.com/peak/s5cmd fix-special-files*
; s5cmd cp fifoo s3://some-bucket/selman/test/; echo $?
0

~/src/github.com/peak/s5cmd fix-special-files*
; s5cmd ls 's3://some-bucket/selman/test/*'
ERROR "ls s3://some-bucket/selman/test/*": no object found

What do you think @ilkinulas?

I added error messages for skipped objects. It can be good to show information messages. I can revert if it is unnecessary.
da3ccd4

@ahmethakanbesel ahmethakanbesel changed the title command: skip special files command: skip nonregular files Aug 4, 2023
@ilkinulas ilkinulas merged commit 393e8dd into peak:master Aug 4, 2023
@ahmethakanbesel ahmethakanbesel deleted the fix-special-files branch August 4, 2023 09:22
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.

s5cmd cp hangs on named pipes/socketfiles

3 participants