mirror of
https://github.com/NLnetLabs/routinator.git
synced 2024-05-19 06:50:04 +00:00
Cope with stray files in the rsync collector’s directory.
This commit is contained in:
@@ -364,7 +364,7 @@ impl<'a> Run<'a> {
|
||||
};
|
||||
|
||||
if !keep {
|
||||
fatal::remove_dir_all(entry.path())?;
|
||||
fatal::remove_all(entry.path())?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ impl<'a> Run<'a> {
|
||||
};
|
||||
|
||||
if !keep {
|
||||
fatal::remove_dir_all(entry.path())?;
|
||||
fatal::remove_all(entry.path())?;
|
||||
}
|
||||
else {
|
||||
keep_host = true;
|
||||
|
||||
@@ -214,6 +214,19 @@ pub fn remove_file(path: &Path) -> Result<(), Failed> {
|
||||
}
|
||||
|
||||
|
||||
//------------ remove_all ----------------------------------------------------
|
||||
|
||||
/// Removes a file or a directory tree.
|
||||
pub fn remove_all(path: &Path) -> Result<(), Failed> {
|
||||
if path.is_dir() {
|
||||
remove_dir_all(path)
|
||||
}
|
||||
else {
|
||||
remove_file(path)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------ rename --------------------------------------------------------
|
||||
|
||||
/// Renames a file or directory.
|
||||
|
||||
Reference in New Issue
Block a user