From 10d2458225994e09cb15637a855d7c49add782c8 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Mon, 11 Dec 2023 07:54:08 +1300 Subject: [PATCH] FF-1151 - touch now creates the file if it does not exist --- BasicNodes/File/Touch.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BasicNodes/File/Touch.cs b/BasicNodes/File/Touch.cs index cf192570..5080f002 100644 --- a/BasicNodes/File/Touch.cs +++ b/BasicNodes/File/Touch.cs @@ -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)