aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Tango.NET/Tango.Core/PathHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Tango.NET/Tango.Core/PathHelper.cs')
-rw-r--r--Software/Tango.NET/Tango.Core/PathHelper.cs32
1 files changed, 32 insertions, 0 deletions
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;
+ }
+ }
+ }
+}