xcp icon indicating copy to clipboard operation
xcp copied to clipboard

Clarify differences with cp

Open desbma opened this issue 6 years ago • 1 comments
trafficstars

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility

I think you should clarify even further where xcp stands compared to coreutil's cp:

  • either state that the behavior of xcp is close to the one of cp, so mention what specific cp options or features are not supported for example. The idea is that users that do not use theses options can safely do alias cp=xcp in their interactive shell, and benefit from the progressbar and speedup. or
  • state that any form of compatibility with cp is not a goal, or even an inspiration

desbma avatar Jun 01 '19 20:06 desbma

Fair point. I'm currently refactoring xcp to better support parallelism, which will require expanding the documentation, so I'll look at this then.

tarka avatar Nov 16 '19 00:11 tarka

Does xcp support preserving attributes?

$ cp --help | rg preserve
  -a, --archive                same as -dR --preserve=all
  -d                           same as --no-dereference --preserve=links
  -p                           same as --preserve=mode,ownership,timestamps
      --preserve[=ATTR_LIST]   preserve the specified attributes (default:
      --no-preserve=ATTR_LIST  don't preserve the specified attributes

ristomatti avatar Dec 11 '23 10:12 ristomatti

xcp does currently preserve some attributes, including permissions and xattrs. There are others we don't ATM, but probably should (timestamps and ownership-when-root). There are other cp options we may decide not to support (e.g. non-numbered-backups).

Basically I'm slowly going through and duplicating features from cp where it seems appropriate. Once that's done I'll write up where xcp differs significantly.

tarka avatar Feb 03 '24 01:02 tarka

Ack. With a few exceptions the times I need to copy either big files or lots of files, they tend to be media files. I definitely want to preserve timestamps of media files. Hopefully this will be added at some point!

ristomatti avatar Feb 03 '24 10:02 ristomatti

Yeah, the timestamps thing is a straight-up oversight on my part. It'll be fixed in the next release.

tarka avatar Feb 04 '24 02:02 tarka

Timestamp copy is now in version 0.20.0. Note that this is enabled by default, which is a difference from cp.

tarka avatar Feb 06 '24 04:02 tarka

Confirmed, awesome! I have no idea what the general opinion is but I've used cp with -a way more than without, so to me it makes more sense as a default. :+1:

ristomatti avatar Feb 06 '24 15:02 ristomatti

See also #50.

tarka avatar Feb 07 '24 01:02 tarka

The README has been updated with notes on cp differences.

tarka avatar Feb 23 '24 03:02 tarka