From 4fbe47ccac2bdcae52aafa07d6a80176e9606bd9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 30 Oct 2017 19:38:10 +0200 Subject: Some more work on protobuf compilers. --- Software/Tango.NET/Tango.Core/PathHelper.cs | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Software/Tango.NET/Tango.Core/PathHelper.cs (limited to 'Software/Tango.NET/Tango.Core/PathHelper.cs') diff --git a/Software/Tango.NET/Tango.Core/PathHelper.cs b/Software/Tango.NET/Tango.Core/PathHelper.cs new file mode 100644 index 000000000..08dbf1c16 --- /dev/null +++ b/Software/Tango.NET/Tango.Core/PathHelper.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core +{ + public static class PathHelper + { + public static String GetTempFolderPath() + { + String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", Path.GetRandomFileName()); + Directory.CreateDirectory(tempDirectory); + return tempDirectory; + } + + public static bool TryDeleteFolder(String path) + { + try + { + Directory.Delete(path, true); + return true; + } + catch + { + return false; + } + } + } +} -- cgit v1.3.1