FF-1151 - touch now creates the file if it does not exist

This commit is contained in:
John Andrews
2023-12-11 07:54:08 +13:00
parent b6304b456a
commit 10d2458225

View File

@@ -39,7 +39,10 @@ public class Touch : Node
{
try
{
System.IO.File.SetLastWriteTimeUtc(filename, DateTime.UtcNow);
if (System.IO.File.Exists(filename))
System.IO.File.SetLastWriteTimeUtc(filename, DateTime.UtcNow);
else
System.IO.File.Create(filename);
return 1;
}
catch (Exception ex)