ref: 使用 DirectoryUtils.Create

This commit is contained in:
龙腾猫跃 committed 2026-04-21 01:10:48 +08:00
1 parent 6bda6d7a89
commit 08b17e71bb
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -23,8 +23,8 @@ namespace MeloongCore {
/// 创建文件夹,或文件所在的文件夹。
/// 支持长路径,文件夹已存在时不会抛出异常。
/// </summary>
public static void Create(string path) {
if (!IsDirectoryFormat(path)) path = Path.GetDirectoryName(path);
public static void Create(string path, bool isFilePath = false) {
if (isFilePath) path = Path.GetDirectoryName(path);
Directory.CreateDirectory(PathUtils.Shorten(path));
}