Aggiunta verifica e creazione directory non esistente alla creazione missing files

This commit is contained in:
Samuele Locatelli
2024-06-20 09:37:01 +02:00
parent 8737eefd31
commit ad772b8160
@@ -237,6 +237,12 @@ namespace WebDoorCreator.Data.Services
// controllo se esiste...
if (!File.Exists(fPath))
{
var fDir = Path.GetDirectoryName(fPath);
// verifico directory...
if(!Directory.Exists(fDir))
{
Directory.CreateDirectory(fDir);
}
// creo file...
var newFile = File.Create(fPath);
Log.Info($"Created missing file: {fPath}");