Check for folder existence?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

What's the best way to check for this? I had been using

Code: Select all

var theFolder = new Folder(folderLocation);
if(theFolder instanceOf folder){
do some stuff
}
I'm getting my location from a text file. It seems to always return a folder even if the text in the file points to an invalid one. Is there a folderExists function?
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

Hi Byron...

Use the exists attribute for the Folder object, as in:

Code: Select all

var theFolder = new Folder(folderLocation);
if (theFolder.exists) {
    do some stuff
}
Hope this helps.

Jeff
Post Reply