You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! Thx for lib, but I have noticed that directory copy behaves in non-idempotent way.
Suppose we have:
let pathbufs = [PathBuf::from("directory1"), PathBuf::from("directory2"), PathBuf::from("directory3")];
let options = fs_extra::dir::CopyOptions {
overwrite: true,
copy_inside: true,
..Default::default()
};
let to = PathBuf::new("current");
for p in pathbufs {
if let Err(e) = fs_extra::dir::copy(&p, &to, &options) {
eprintln!(
"Failed to copy directory: {:?} path: {}",
e,
p.display()
);
}
}
First time running copying content of the directory1 in the root of the current path, and the second time it works as I want - I have all 3 dirs there but with directory1 files from previous run. Is there a way to copy all 3 directories if there are no current/ directory created previously?
Hey! Thx for lib, but I have noticed that directory copy behaves in non-idempotent way.
Suppose we have:
First time running copying content of the
directory1
in the root of thecurrent
path, and the second time it works as I want - I have all 3 dirs there but withdirectory1
files from previous run. Is there a way to copy all 3 directories if there are nocurrent/
directory created previously?Result after 1st run:
Result after 2nd run
I understand that this is exactly the behavior of
cp -r
on Linux, but maybe there could be a flag for this case?The text was updated successfully, but these errors were encountered: