check file
This commit is contained in:
@@ -122,17 +122,18 @@ pub fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem
|
|||||||
Ok(open_pgp_tool) => open_pgp_tool,
|
Ok(open_pgp_tool) => open_pgp_tool,
|
||||||
};
|
};
|
||||||
|
|
||||||
let temp_zip_file = &format!("temp_file_{}.zip", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
|
let secs = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs();
|
||||||
let temp_pgp_file = &format!("temp_file_{}.gpg", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs());
|
let temp_zip_file = &format!("temp_file_{}.zip", secs);
|
||||||
|
let temp_pgp_file = &format!("temp_file_{}.gpg", secs);
|
||||||
|
|
||||||
let remove_temp_files = || {
|
let remove_temp_files = || {
|
||||||
if Path::new(temp_zip_file).exists() {
|
if Path::new(temp_zip_file).is_file() {
|
||||||
if options.verbose {
|
if options.verbose {
|
||||||
print_message(MessageType::DEBUG, &format!("Remove file: {}", temp_zip_file));
|
print_message(MessageType::DEBUG, &format!("Remove file: {}", temp_zip_file));
|
||||||
}
|
}
|
||||||
fs::remove_file(temp_zip_file).ok();
|
fs::remove_file(temp_zip_file).ok();
|
||||||
}
|
}
|
||||||
if Path::new(temp_pgp_file).exists() {
|
if Path::new(temp_pgp_file).is_file() {
|
||||||
if options.verbose {
|
if options.verbose {
|
||||||
print_message(MessageType::DEBUG, &format!("Remove file: {}", temp_pgp_file));
|
print_message(MessageType::DEBUG, &format!("Remove file: {}", temp_pgp_file));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user