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

ForceDirectoriesUTF8

Creates the specified directories if they do not already exist

Declaration

Source position: lazfileutils.pas line 124

function ForceDirectoriesUTF8(

  const Dir: string

):Boolean;

Arguments

Dir

  

Path information to examine the function

Function result

True when directories exist or are successfully created in the function

Description

ForceDirectories is a Boolean function which creates the specified directories if they do not already exist. ForceDirectories examines the value in Dir to determine if it contains a Windows device identifier or a UNC name. If a device identifer or UNC name is found, but not supported on the platform, no actions are perfomed in the function.

ForceDirectories raises an EInOutError exception with the message in SCannotCreateEmptyDir when Dir contains an empty string ('').

Each directory in the specified path is checked using DirectoryExistsUTF8. ForceDirectories 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.

Errors

EIOnOutError
Raised when the directory name is an empty string (''); Message is SCannotCreateEmptyDir, and ErrorCode is set to 3.

See also

ForceDirectory

  

Creates the specified directory if it does not already exist

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