Navigation

Search

deltree

Description

Deletes a directory, and all the files and direcories inside it.

Syntax

void deltree (string $dir[, bool $delete_dir])



Parameter $dir

Expected type: String
Description: The path to the directory whose contents you wish to delete



Parameter $delete_dir

Expected type: Boolean
Description: Whether or not to delete the directory specified by $dir as well. Default is true.


Notes

  • Requires appropriate access to delete these files.
  • Recursively calls itself when it finds a directory.
  • Attempts to chmod stuff before deleting it if it's not writable.
View all versions of this function