1
This commit is contained in:
@@ -35,7 +35,7 @@ namespace BITKit
|
||||
public static void EnsureDirectoryCreated(string path)
|
||||
{
|
||||
path = Path.GetDirectoryName(path);
|
||||
if (Directory.Exists(path) is true) return;
|
||||
if (Directory.Exists(path)) return;
|
||||
if (path != null) Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
@@ -44,21 +44,17 @@ namespace BITKit
|
||||
var path = GetPath(paths);
|
||||
var dictionaryPath = Path.GetDirectoryName(path);
|
||||
Directory.CreateDirectory(dictionaryPath);
|
||||
if (File.Exists(path) is false)
|
||||
{
|
||||
using (var fs = File.Create(path))
|
||||
{
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
}
|
||||
}
|
||||
if (File.Exists(path)) return path;
|
||||
using var fs = File.Create(path);
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public static string GetTempFilePath(string fileName = null)
|
||||
{
|
||||
var path = GetFilePath("Temps", fileName is null ? Guid.NewGuid().ToString() : fileName);
|
||||
var path = GetFilePath("Temps", fileName ?? Guid.NewGuid().ToString());
|
||||
return path;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user