Skip to content

Commit

Permalink
correct CoW command for macOS
Browse files Browse the repository at this point in the history
fixes #219
  • Loading branch information
kapitainsky authored and pkolaczk committed Aug 10, 2023
1 parent cfd95f9 commit bbc2592
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fclones/src/dedupe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ impl FsCommand {
let link = link.path.quote();
// Not really what happens on Linux, there the `mv` is also a reflink.
result.push(format!("mv {} {}", link, tmp.quote()));
result.push(format!("cp --reflink=always {target} {link}"));
if cfg!(target_os = "macos") {
result.push(format!("cp -c {target} {link}"));
} else {
result.push(format!("cp --reflink=always {target} {link}"));
};
result.push(format!("rm {}", tmp.quote()));
}
FsCommand::Move {
Expand Down

0 comments on commit bbc2592

Please sign in to comment.