fix multiple packet in single handle_buffer call, set server as stopped when proxy connection failed and container can't be found
This commit is contained in:
@ -63,23 +63,18 @@ pub async fn extract_archive(archive_path: String, output: String) -> Result<(),
|
||||
|
||||
|
||||
pub fn move_all_elements(src: &Path, dst: &Path) -> io::Result<()> {
|
||||
// 1. Ensure the destination directory exists; if not, create it
|
||||
if !dst.exists() {
|
||||
fs::create_dir_all(dst)?;
|
||||
println!("Created destination directory: {:?}", dst);
|
||||
}
|
||||
|
||||
// 2. Read the contents of the source directory
|
||||
for entry in fs::read_dir(src)? {
|
||||
let entry = entry?;
|
||||
let file_name = entry.file_name();
|
||||
|
||||
// 3. Construct the new path (destination + filename)
|
||||
let old_path = entry.path();
|
||||
let new_path = dst.join(file_name);
|
||||
|
||||
// 4. Perform the move
|
||||
// fs::rename works for both files and directories
|
||||
fs::rename(&old_path, &new_path)?;
|
||||
println!("Moved: {:?} -> {:?}", old_path, new_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user