javascript _ folder exists and create
I know the script for testing if file exists (file.isopen)
It does not work with folders.
Is there an equivalent of Java 'import java.io.*' in max6 or max7?
I want to keep it in javascript cos it's part of a bigger db scripting
Thanks
there is Folder object in JS with which u can scan specified location for files . U can retrieve names of files and folders , paths , sizes .etc .
You can restrict it to scan for folders only too .
var fold = new Folder("c:");
fold.typelist = ["fold"] ;
while(!fold.end){
post(fold.filename,"\n");
fold.next();
}
Strictly for testing if the folder exists. No iteration through files...
function folderExists(file){
var fold = new Folder(file);
if (fold.end) {
return (false);
}
else {
return (true);
}
}
cool