V
Victory
Hi,
I am using C# to analyze data from some customer. The have
a disk which i don't know where it came from. On this disk,
there is a directory called "bb label.qxd ". If you notice
there is a space in this name. The extension i found out
that is a QuarkExpress. When i use the explorer, i see this
as a directory, when i open it, there are files within it.
But my code, goes through the exception block with message
being the full path to the directory and nothing else. I
rebooted my system and still get the same thing. I examined
the exception and i see these numbers
HResult -2147024893)
and (COM -532459699). I used the Immediate window and
before my crash point, tried File.Exists(sDir) and
Directory.Exists(sDir) but both of them cause the same
exception. Any ideas?
private void getDirectoryFiles(ArrayList fC, string
sRoot)
{
//read all the directory names in the root
provided
string[] sDirs = new string[1];
try
{
if
(Directory.GetAccessControl(sRoot).AreAccessRulesProtected
== false)
{
sDirs =
Directory.GetDirectories(sRoot); //<---- Access Denied
error
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory access error: " +
e.Message);
}
if (!m_bDirError)
{
foreach (string sDir in sDirs)
{
if (this.m_bCancel == false && sDir !=
null)
{
try
{
if
(Directory.GetAccessControl(sDir).AreAccessRulesProtected
== false)
{
if
(((File.GetAttributes(sDir) & FileAttributes.ReparsePoint)
!= FileAttributes.ReparsePoint))
{
getDirectoryFiles(fC,
sDir);
}
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory <" + sDir +
"> access error: " + e.Message);
}
try
{
if
(Directory.GetAccessControl(sRoot).AreAccessRulesProtected
== false)
{
string[] sFiles =
Directory.GetFiles(sRoot);
fC.Add(sFiles);
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory <" + sRoot + ">
access error: " + e.Message);
}
}
Mars
I am using C# to analyze data from some customer. The have
a disk which i don't know where it came from. On this disk,
there is a directory called "bb label.qxd ". If you notice
there is a space in this name. The extension i found out
that is a QuarkExpress. When i use the explorer, i see this
as a directory, when i open it, there are files within it.
But my code, goes through the exception block with message
being the full path to the directory and nothing else. I
rebooted my system and still get the same thing. I examined
the exception and i see these numbers

and (COM -532459699). I used the Immediate window and
before my crash point, tried File.Exists(sDir) and
Directory.Exists(sDir) but both of them cause the same
exception. Any ideas?
private void getDirectoryFiles(ArrayList fC, string
sRoot)
{
//read all the directory names in the root
provided
string[] sDirs = new string[1];
try
{
if
(Directory.GetAccessControl(sRoot).AreAccessRulesProtected
== false)
{
sDirs =
Directory.GetDirectories(sRoot); //<---- Access Denied
error
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory access error: " +
e.Message);
}
if (!m_bDirError)
{
foreach (string sDir in sDirs)
{
if (this.m_bCancel == false && sDir !=
null)
{
try
{
if
(Directory.GetAccessControl(sDir).AreAccessRulesProtected
== false)
{
if
(((File.GetAttributes(sDir) & FileAttributes.ReparsePoint)
!= FileAttributes.ReparsePoint))
{
getDirectoryFiles(fC,
sDir);
}
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory <" + sDir +
"> access error: " + e.Message);
}
try
{
if
(Directory.GetAccessControl(sRoot).AreAccessRulesProtected
== false)
{
string[] sFiles =
Directory.GetFiles(sRoot);
fC.Add(sFiles);
}
}
catch (Exception e)
{
m_bDirError = true;
LogError("Directory <" + sRoot + ">
access error: " + e.Message);
}
}
Mars