This commit is contained in:
2025-03-31 19:08:35 +02:00
parent 4dd31dfe18
commit 91e033a2ec
12 changed files with 247 additions and 77 deletions

View File

@ -16,11 +16,18 @@ public class MoveFileOrFolderJob(string fromLocation, string toLocation, string?
{
try
{
FileInfo fi = new FileInfo(FromLocation);
FileInfo fi = new (FromLocation);
if (!fi.Exists)
{
Log.Error($"File does not exist at {FromLocation}");
return [];
}
if (File.Exists(ToLocation))//Do not override existing
{
Log.Error($"File already exists at {ToLocation}");
return [];
}
if(fi.Attributes.HasFlag(FileAttributes.Directory))
MoveDirectory(fi, ToLocation);
else
@ -28,7 +35,7 @@ public class MoveFileOrFolderJob(string fromLocation, string toLocation, string?
}
catch (Exception e)
{
Log.Error(e);
}
return [];