1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

cp: accept the --reflink option

* NEWS: Mention it.
* doc/coreutils.texi (cp invocation): Describe it.
* src/copy.h (struct cp_options) [reflink]: New member.
* src/copy.c (usage): Describe it.
(copy_reg): If reflink is true try to clone the file.
(main): Check for --reflink.
(cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Initialize the new member.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/sparse: Add a new test case.
This commit is contained in:
Giuseppe Scrivano
2009-08-01 19:36:48 +02:00
committed by Jim Meyering
parent ff159a605e
commit a1d7469835
8 changed files with 46 additions and 6 deletions

View File

@@ -7543,6 +7543,15 @@ Also, it is not portable to use @option{-R} to copy symbolic links
unless you also specify @option{-P}, as @acronym{POSIX} allows
implementations that dereference symbolic links by default.
@item --reflink
@opindex --reflink
Perform a lightweight, copy-on-write (COW) copy.
Copying with this option can succeed only on some relatively new file systems.
Once it has succeeded, beware that the source and destination files
share the same disk data blocks as long as they remain unmodified.
Thus, if a disk I/O error affects data blocks of one of the files,
the other suffers the exact same fate.
@item --remove-destination
@opindex --remove-destination
Remove each existing destination file before attempting to open it