Sign in Join
FPDoc Onlineexperiment

DeleteDirectory function

In unit FileUtil

Deletes the specified directory (or only its contents when OnlyChildren is True).

Declaration

pascal
function DeleteDirectory(const DirectoryName: string; 
 OnlyChildren: Boolean; Force: Boolean; 
 out Culprit: string): Boolean

Description

Returns True when the specified entries are deleted on the local file system. Returns False when:

  • DirectoryName is one of the relative path indicators like '.' or '..'
  • DirectoryName is an empty string ('')
  • DirectoryName does not exist on the local file system
  • The process does not have permissions needed to delete the directory or its content

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.