ref: FileUtils 中的文件写入
This commit is contained in:
1 parent
b904ca23af
commit
53ed257072
4 files changed
+48
-8
No files matched your search
@@ -13,11 +13,13 @@ public static class DirectoryUtils {
|
||||
|
||||
/// <summary>
|
||||
/// 创建文件夹,或文件所在的文件夹。
|
||||
/// 支持长路径,文件夹已存在时不会抛出异常。
|
||||
/// 支持长路径。
|
||||
/// 文件夹已存在时不会抛出异常。
|
||||
/// </summary>
|
||||
public static void Create(string path, bool isFilePath = false) {
|
||||
path = FileUtils.ShortenPath(path);
|
||||
if (isFilePath) path = Path.GetDirectoryName(path);
|
||||
Directory.CreateDirectory(PathUtils.Shorten(path));
|
||||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user