diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Console/ConsoleUtil.cs | 19 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | ||
30 | using System.Linq; | 31 | using System.Linq; |
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using log4net; | 33 | using 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. |