-
-
Notifications
You must be signed in to change notification settings - Fork 109
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
currently, I have to manually create the path first before using a custom name with the path that might not exist already.
Describe the solution you'd like
public override string FileName { get; set; } =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"foo","bar","AppConfig.json");if the above folders. foo & bar does not exist, Data helper should create them, before creating AppConfig.json.
Additional context
This method might come in handy
public static void CreateFile(string fullFilePath)
{
var fileName = Path.GetFileName(fullFilePath);
var pathWithoutFileName = fullFilePath.Replace(fileName, "");
Directory.CreateDirectory(pathWithoutFileName);
if (string.IsNullOrEmpty(fileName))
fileName = "AppConfig.json";
File.Create(Path.Combine(pathWithoutFileName, fileName));
}Reactions are currently unavailable