fix: 无法删除部分文件夹(Meloong-Git/PCL#8878,@Peacock-Que)

This commit is contained in:
龙腾猫跃 committed 2026-07-03 14:15:10 +08:00
1 parent c16ef849e6
commit cf42cf19e3
2 files changed
+13 -1

No files matched your search

+1 -1
View File
@@ -169,7 +169,7 @@ public static class DirectoryUtils {
folder = PathUtils.ForCompare(folder);
if (folder == PathUtils.ForCompare(Path.GetPathRoot(folder)))
throw new UnauthorizedAccessException($"不应操作磁盘根目录:{folder}");
if (criticalFolders.Value.Any(f => PathUtils.IsParentOf(f, folder)))
if (criticalFolders.Value.Any(f => PathUtils.IsParentOf(folder, f)))
throw new UnauthorizedAccessException($"不应操作文件夹:{folder}");
}
private static readonly Lazy<HashSet<string>> criticalFolders = new(() => new(new[] {