By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,475 Members | 954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,475 IT Pros & Developers. It's quick & easy.

String is a valid directory

P: n/a
What's the most efficient way to determine if an arbitrary string is a path to a valid, existing directory?

Also, how can I convert the string to the same case as the original directory, assuming that the existing directory is mixed case
and the string is lower case?

TIA,

--
Al Reid
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Al Reid" <ar*****@reidDASHhome.com> schrieb:
What's the most efficient way to determine if an arbitrary string is a
path to a valid, existing directory?


'System.IO.Directory.Exists', 'System.IO.DirectoryInfo.Exists'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message news:eI*************@TK2MSFTNGP15.phx.gbl...
"Al Reid" <ar*****@reidDASHhome.com> schrieb:
What's the most efficient way to determine if an arbitrary string is a
path to a valid, existing directory?


'System.IO.Directory.Exists', 'System.IO.DirectoryInfo.Exists'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


I guess I could do a quick timing test, but do you think that they are faster than the old

(GetAttr(strFilePath) And FileAttribute.Directory) = FileAttribute.Directory

I have potentially thousands of files and directories to handle in a short time frame and I want to use the fastest method.

--

Al Reid
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.