aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Console/ConsoleUtil.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
index 5c25ccb..3ebfdf8 100644
--- a/OpenSim/Framework/Console/ConsoleUtil.cs
+++ b/OpenSim/Framework/Console/ConsoleUtil.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO;
30using System.Linq; 31using System.Linq;
31using System.Reflection; 32using System.Reflection;
32using log4net; 33using log4net;
@@ -60,6 +61,24 @@ namespace OpenSim.Framework.Console
60 61
61 public const string VectorSeparator = ","; 62 public const string VectorSeparator = ",";
62 public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray(); 63 public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray();
64
65 /// <summary>
66 /// Check if the given file path exists.
67 /// </summary>
68 /// <remarks>If not, warning is printed to the given console.</remarks>
69 /// <returns>true if the file does not exist, false otherwise.</returns>
70 /// <param name='console'></param>
71 /// <param name='path'></param>
72 public static bool CheckFileDoesNotExist(ICommandConsole console, string path)
73 {
74 if (File.Exists(path))
75 {
76 console.OutputFormat("File {0} already exists. Please move or remove it.", path);
77 return false;
78 }
79
80 return true;
81 }
63 82
64 /// <summary> 83 /// <summary>
65 /// Try to parse a console UUID from the console. 84 /// Try to parse a console UUID from the console.