mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
* Added primitive exception logging capabilities.
* Disabled by default (see OpenSim.ini.example for how to enable) * Saves exceptions to a folder on disk (default "crashes") when enabled. * These reports can then be uploaded or posted to help debug an error.
This commit is contained in:
@@ -560,6 +560,34 @@ namespace OpenSim.Framework
|
||||
return ".";
|
||||
}
|
||||
|
||||
// From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html
|
||||
public static string GetUniqueFilename(string FileName)
|
||||
{
|
||||
int count = 0;
|
||||
string Name;
|
||||
|
||||
if (File.Exists(FileName))
|
||||
{
|
||||
FileInfo f = new FileInfo(FileName);
|
||||
|
||||
if (!string.IsNullOrEmpty(f.Extension))
|
||||
{
|
||||
Name = f.FullName.Substring(0, f.FullName.LastIndexOf('.'));
|
||||
}
|
||||
else
|
||||
{
|
||||
Name = f.FullName;
|
||||
}
|
||||
|
||||
while (File.Exists(FileName))
|
||||
{
|
||||
count++;
|
||||
FileName = Name + count + f.Extension;
|
||||
}
|
||||
}
|
||||
return FileName;
|
||||
}
|
||||
|
||||
// Nini (config) related Methods
|
||||
public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user