Create the specified tree structure with the specified mode.


bool mktree (string $strPath, int $mode)

Parameter $strPath

Expected type: String
Description: The directory path - should include at least one directory that doesn't exist yet

Parameter $mode

Expected type: Integer
Description: What value to chmod each directory/file after creating it (or false to leave it at the server's default levels)

Return value

Expected type: Boolean
Description: True if successful, false otherwise


  • Attempts to create every directory in the path until it finds one that already exists
  • Requires either appropriate chmods or the appropriate access to chmod things
  • Attempts to chmod things to the specified value, unless mode is false.