User Tools

Site Tools


Sidebar

folder:isfolder

isFolder()

Function to check whether an object is a Folder object and whether the folder exists on the file system.

Usage

To check whether the variable is a folder object:

var folder = new Folder("C:/myfolder");
if(isFolder(folder)) {
  //Do something if this is a folder.
}

To check wether the variable is a folder object and to check that the folder exists.

var folder = new Folder("C:/myfolder");
if(isFolder(folder, true)) {
  //Do something if this is a folder and when this folder exists.
}

Parameters

Parameter Data type Required Description
folder all Yes The object to check. You can parse any kind of object, string or variable to this function
mustexist boolean If set to true the function also checks that the folder exists on the file system. Default is false

Return Values

Value Meaning
true The specified object is a folder object. When the parameter mustexist is set to true, this return value also means that the folder exists on the file system
false The specified object is not a folder object. When the parameter mustexist is set to true, this return can also mean that the folder does not exist on the file system even when the object is a folder object
folder/isfolder.txt · Last modified: 2017/05/25 11:37 (external edit)