From c4df931b81678187c9019f7569d8b8bcf3be94ce Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 25 Sep 2023 01:39:09 +0800 Subject: [PATCH] .. --- core/src/tasks/workers/file.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/tasks/workers/file.rs b/core/src/tasks/workers/file.rs index c1f6ef5e..7060b43d 100644 --- a/core/src/tasks/workers/file.rs +++ b/core/src/tasks/workers/file.rs @@ -131,8 +131,11 @@ impl File { Cow::Borrowed(task.from.as_path()) }; - let src = - if task.relative { path_relative_to(&src, task.to.parent().unwrap()) } else { src }; + let src = if task.relative { + path_relative_to(&src, &fs::canonicalize(task.to.parent().unwrap()).await?) + } else { + src + }; match fs::remove_file(&task.to).await { Err(e) if e.kind() != NotFound => Err(e)?,