拆分代码4

This commit is contained in:
2026-02-04 20:13:21 +08:00
parent b5ecee05b7
commit 3cc6d2c92a
20 changed files with 676 additions and 456 deletions

View File

@@ -0,0 +1,29 @@
using System;
namespace CMLeonOS.Commands.FileSystem
{
public static class RmdirCommand
{
public static void ProcessRmdir(CMLeonOS.FileSystem fileSystem, string args, bool fixMode, Action<string> showError)
{
if (string.IsNullOrEmpty(args))
{
showError("Please specify a directory name");
}
else
{
bool isInSysFolder = (args.Contains(@"\system\") || args.Contains(@"/sys/")) && !fixMode;
if (isInSysFolder)
{
showError("Cannot delete directories in sys folder");
showError("Use fix mode to bypass this restriction");
}
else
{
fileSystem.DeleteDirectory(args);
}
}
}
}
}