aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Tango.NET/Tango.Core/PathHelper.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-10-30 19:38:10 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-10-30 19:38:10 +0200
commit4fbe47ccac2bdcae52aafa07d6a80176e9606bd9 (patch)
tree333dd813958bcb74a7d21a81f6cee28c47aba53b /Software/Tango.NET/Tango.Core/PathHelper.cs
parentc5bb832c1880d0a0d55c3ba11cf97cc6dff6a78d (diff)
downloadTango-4fbe47ccac2bdcae52aafa07d6a80176e9606bd9.tar.gz
Tango-4fbe47ccac2bdcae52aafa07d6a80176e9606bd9.zip
Some more work on protobuf compilers.
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;
+ }
+ }
+ }
+}