From 1af81dfb4d24d104777b8917544d81097db0deab Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 21 Sep 2009 08:43:03 +0100 Subject: cp: add an option to only copy the file attributes * src/copy.c (copy_attr): A new function which merges copy_attr_by_fd and copy_attr_by_name. Also display all errors when --attributes-only * src/copy.c (copy_reg): Skip copying the file contents if specified. Refactor the SELinux error handling code a little and display all SELinux errors when only copying attributes. * src/copy.h (struct cp_options): Add a data_copy_required boolean * src/cp.c (main): Default to copying data but don't if specified * src/install.c: Default to copying data * src/mv.c: Likewise tests/cp/reflink-perm: Add a test to check that --attributes-only does not copy data * tests/cp/acl: Likewise. Also refactor to remove redundant acl manipulation * doc/coreutils.texi (cp invocation): Describe the new option * NEWS: Mention the new feature --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 2bacb7f0e..3a249254f 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ GNU coreutils NEWS -*- outline -*- ** New features + cp now accepts the --attributes-only option to not copy file data, + which is useful for efficiently modifying files. + du recognizes -d N as equivalent to --max-depth=N, for compatibility with FreeBSD. -- cgit v1.2.3-54-g00ecf