DirectoryCreate()

edit

Creates new directory for specified path

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

Returns: void

Argument Description Default
path
string, required
edit

Absolute path of the directory to be created

createPath
boolean, optional
edit

Create parent directory when not exist

Alias: doParent

true

ignoreExists
boolean, optional
edit

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
edit

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

777

Examples

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

See also