469,572 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

"System Volume Information" directory

Hi, i check all directories on a disk but an error occurs
when i try to enter in the "System Volume Information"
directory.

Is there a way to "jump" this directory without to check
the name of the current directory to verify it's
not "System Volume Information" ?

Or, how to catch this error and continue the process when
the error occurs ?

Thanks.
Nov 15 '05 #1
1 4617
Just checking the name wouldn't be safe at all times either, other
directories may throw permission errors.
basically, you need to wrap your code in try-catch blocks, something like
string[] directories = <get folders>;
foreach (string directory in directories)
{
try
{
//do wahtever you need to with the directory.
}
catch (IOException ioe) {
//handle IOException conditions
}
catch (UnauthorizedAccessException uae) {
//handle UnauthorizedAccessException conditions
}
finally {
//do any code that must occur in any case.
}
}

should suffice, UnauthorizedAccessException should handle filesystem
permission issues, the documentation for the various IO methods will have
more information on what specific exceptions they can throw.
You should be able to find more information on exception handling in msdn.
"Krazitchek" <kr********@hotmail.com> wrote in message
news:09****************************@phx.gbl...
Hi, i check all directories on a disk but an error occurs
when i try to enter in the "System Volume Information"
directory.

Is there a way to "jump" this directory without to check
the name of the current directory to verify it's
not "System Volume Information" ?

Or, how to catch this error and continue the process when
the error occurs ?

Thanks.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by T O | last post: by
11 posts views Thread by Paminu | last post: by
5 posts views Thread by msigwald | last post: by
2 posts views Thread by alex | last post: by
8 posts views Thread by Henrik | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.