Skip to main content

The "filename_is_dir" Function

Syntax#

filename_is_dir(fname);
ArgumentTypeDescription
fnamestringThe full path to check

Description#

Checks if a filename appears to be a directory based on string properties and returns true or false. This is faster than directory_exists, and is useful for checking paths outside the sandbox.

caution

To achieve best processing speed, files without extensions are not supported by this script.

Example#

var file = file_find_first("C:\\*", fa_directory);
if (filename_is_dir(file)) {
//Directory exists!
}