[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

ForceDirectory

Creates the specified directory if it does not already exist

Declaration

Source position: lazfileutils.pas line 47

function ForceDirectory(

  DirectoryName: string

):Boolean;

Arguments

DirectoryName

  

Path information for the operation

Function result

Returns True if directory exists or if it was successfully created

Description

ForceDirectory is a Boolean function which creates the specified directory if it does not already exist. ForceDirectory ensures that a trailing path delimiter exists in DirectoryName prior to checking the file system. Each directory in the specified path is examined in the function using DirPathExists. ForceDirectory calls CreateDirUTF8 if a directory does not exist, and may exit with a return value of False if directory creation is not successful.

The return value is True if all directories in the path information already exist, or are successfully created in the function.

See also

ForceDirectoriesUTF8

  

Creates the specified directories if they do not already exist

The latest version of this document can be found at lazarus-ccr.sourceforge.net.