summaryrefslogtreecommitdiff
path: root/src/copy.h
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-09-21 08:43:03 +0100
committerPádraig Brady <P@draigBrady.com>2010-07-01 14:33:27 +0100
commit1af81dfb4d24d104777b8917544d81097db0deab (patch)
tree3030f158798f4246a3b7d38ba9262adb57705849 /src/copy.h
parent8aa15b2be2bd2ab4b76d197a279abf8b9091680a (diff)
downloadcoreutils-1af81dfb4d24d104777b8917544d81097db0deab.tar.gz
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
Diffstat (limited to 'src/copy.h')
-rw-r--r--src/copy.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/copy.h b/src/copy.h
index 59e29f53b..7c7e3f312 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -170,6 +170,10 @@ struct cp_options
will be hard links to the same file (a copy of F). */
bool preserve_links;
+ /* Optionally don't copy the data, either with CoW reflink files or
+ explicitly with the --attributes-only option. */
+ bool data_copy_required;
+
/* If true and any of the above (for preserve) file attributes cannot
be applied to a destination file, treat it as a failure and return
nonzero immediately. E.g. for cp -p this must be true, for mv it