Page 1 of 1

Checking if directory exists

Posted: Fri Sep 26, 2008 2:52 am
by warrenk
What is the best way to check if a directory exists?

I have been using...

set the defaultfolder to tFolderToSearch
if the result is "can't open directory" then....

Not sure if this is correct?

Warren

Posted: Fri Sep 26, 2008 3:25 am
by FourthWorld
Warren, you're going to love this one: Rev has a "there is" operator, e.g.:

Code: Select all

if there is a folder tFolderToSearch then
Nice, eh?

Rev also supports "there is not":

Code: Select all

if there is not a folder tFolderToSearch then
You can use these with files, folders, and object descriptors.

Posted: Fri Sep 26, 2008 4:33 am
by warrenk
Richard,

Thanks! This looks a lot better then the method I was using.

Appreciate the help!
Warren