DirectoryCreate()

Creates new directory for specified path

DirectoryCreate( path=string, createPath=boolean, ignoreExists=boolean, mode=string );

Returns: void

Argument Description Default
path
string, required

Absolute path of the directory to be created

createPath
boolean, optional

Create parent directory when not exist

Alias: doParent

true

ignoreExists
boolean, optional

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

false

mode
string, optional

Mode to for the new directory, pass -1 to inherit

Introduced: 6.2.1.7

777

Examples

// This will create parent directory when not exist
  directoryCreate( expandPath('images/uploads'), true, true);

See also