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

GetAppConfigDirUTF8

Gets the directory for application configuration and data files.

Declaration

Source position: lazfileutils.pas line 155

function GetAppConfigDirUTF8(

  Global: Boolean;

  Create: Boolean = False

):string;

Arguments

Global

  

Indicates if the system-wide (not user specific) directory is used.

Create

  

Indicates if missing directories in the path should be created.

Function result

Path to the directory used for application configuration or data files.

Description

GetAppConfigDirUTF8 is a String function used to get the directory on the local file system where application configuration and data files are stored.

Global is a Boolean argument that determines if the directory is user- or system- specific. When Global contains False, the home directory for the user is used as the path in the return value.

Create is a Boolean argument that indicates if the configuration directory should be created if not already present on the local file system.

The implementation of GetAppConfigDirUTF8 is platform- and/or OS-specific.

For the Amiga platform, the GetAppConfigDir in the SysUtils unit is called to get the return value.

For Windows environments, the SHGetFolderPathUTF8 function is called to get the path information. The CSIDL (Constant Special Item ID List) required for the setting in Global and the target platform is passed to the routine. When VendorName is provided, it is appended to the path information. ApplicationName is also appended to the path information. If the path cannot be determined, the value from DGetAppConfigDir is used as the directory path.

For UNIX-like environments, the GetAppConfigDir function in the SysUtils unit is called to get the path information.

If the directory does not exist and Create contains True, the ForceDirectoriesUTF8 routine is called to create any missing directories for the path. An EInOutError exception is raised if any missing directory in the path cannot be created.

GetAppConfigDirUTF8 is used in the implementation of the Lazarus IDE and help viewer (LHelp).

See also

ForceDirectoriesUTF8

  

Creates the directories specified in Dir if they do not already exist.

GetAppConfigDir


Version 3.2 Generated 2024-02-25 Home