fully working file duplicator

This commit is contained in:
brxken128 2023-01-17 12:54:30 +00:00
parent bd8b6446aa
commit b9f4d59bf4

View file

@ -126,6 +126,16 @@ impl StatefulJob for FileDuplicatorJob {
obj_type,
},
});
let path_suffix = entry
.path()
.strip_prefix(job_state.root_path.clone())
.unwrap()
.to_path_buf();
let mut path = job_state.root_prefix.clone();
path.push(path_suffix);
std::fs::create_dir_all(path)?;
} else {
let obj_type = ObjectType::File;
state.steps.push_back(FileDuplicatorJobStep {
@ -138,17 +148,6 @@ impl StatefulJob for FileDuplicatorJob {
});
};
let mut path_suffix = entry
.path()
.strip_prefix(job_state.root_path.clone())
.unwrap()
.to_path_buf();
path_suffix.set_file_name("");
let mut path = job_state.root_prefix.clone();
path.push(path_suffix);
std::fs::create_dir_all(path)?;
ctx.progress(vec![JobReportUpdate::TaskCount(state.steps.len())]);
}
}