Creates an on-disk or in-memory directory in the specified path

directoryCreate(path) → returns void

directoryCreate Argument Reference

path string

Absolute path of the directory to be created. Alternatively, you can specify an IP address, as in the following example: DirectoryCreate("//". NOTE: You have to have the required permissions to run this function.);

createPath boolean
Default: true

Lucee Only. Create parent directory when it doesn't exist.

ignoreExists boolean
Default: false

Pass false (default) to throw an error if the directory already exists, or true to skip the create operation without an error.

Examples sample code invoking the directoryCreate function

Checking if a directory called 'icons' exists and then creating the directory if it does not exist.

if (!directoryExists(expandPath('/assets/img/icons'))) {

Expected Result: The directory 'icons' will be created under the img folder.

Fork me on GitHub