webdesus / fs_extra

Expanding opportunities standard library std::fs and std::io
MIT License
297 stars 47 forks source link

Request: reflink #67

Open KSXGitHub opened 1 year ago

KSXGitHub commented 1 year ago

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:

xenoterracide commented 8 months ago

Also increases longevity of your hard drive (probably negligible, but still). I would expect this to be the default, like it is in cp