Function cacache::reflink_sync
source · pub fn reflink_sync<P, K, Q>(cache: P, key: K, to: Q) -> Result<()>Expand description
Creates a reflink/clonefile from a cache entry to a destination path.
Fails if the destination is on a different filesystem or if the filesystem does not support reflinks.
Currently, reflinks are known to work on APFS (macOS), XFS, btrfs, and ReFS (Windows DevDrive)
§Example
use async_std::prelude::*;
use async_attributes;
#[async_attributes::main]
async fn main() -> cacache::Result<()> {
cacache::reflink_sync("./my-cache", "my-key", "./data.txt")?;
Ok(())
}