By default, the cp command on Linux will attempt to reflink on Copy-on-Write filesystems (--reflink=auto). I think the CopyOptions struct should have similar option.
For example, if CopyOptions::reflink is set to RefLink::Auto, the copy function will use the reflink_or_copy function from the reflink crate to copy files.
The advantages of reflink:
- It is faster to reflink big files than to copy big files.
- It is faster to reflink many files recursively than to copy many files recursively.
- It saves disk spaces.
By default, the
cpcommand on Linux will attempt to reflink on Copy-on-Write filesystems (--reflink=auto). I think theCopyOptionsstruct should have similar option.For example, if
CopyOptions::reflinkis set toRefLink::Auto, thecopyfunction will use thereflink_or_copyfunction from thereflinkcrate to copy files.The advantages of reflink: