Add extensive debug output to Util.Glob

arthursv
Melanie 2009-08-07 21:59:54 +01:00
parent 6c6527caae
commit e97beb07c9
1 changed files with 9 additions and 0 deletions

View File

@ -1113,6 +1113,7 @@ namespace OpenSim.Framework
public static string[] Glob(string path)
{
m_log.DebugFormat("[GLOB]: Globbing {0}", path);
string vol=String.Empty;
if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar)
@ -1145,18 +1146,26 @@ namespace OpenSim.Framework
List<string> addpaths = new List<string>();
foreach (string p in paths)
{
m_log.DebugFormat("[GLOB]: Getting directories (wildcard: {0}) from path {1}", c, p);
string[] dirs = Directory.GetDirectories(p, c);
if (dirs.Length != 0)
{
foreach (string dir in dirs)
{
m_log.DebugFormat("[GLOB]: Adding path {0} to search list", Path.Combine(path, dir));
addpaths.Add(Path.Combine(path, dir));
}
}
m_log.DebugFormat("[GLOB]: Getting files (wildcard: {0}) from path {1}", c, p);
string[] files = Directory.GetFiles(p, c);
foreach (string f in files)
{
m_log.DebugFormat("[GLOB]: Adding file {0} to result list", f);
found.Add(f);
}
}
paths = addpaths;
}