Description

Gets all the sections of an initialization file. An initialization file assigns values to configuration variables, also known as entries, that are set when the system boots, the operating system comes up, or an application starts. An initialization file has the suffix INI; for example, boot.ini, Win32.ini.

Returns

An initialization file, as a structure whose format is as follows:

  • Each initialization file section name is a key in the structure
  • Each list of entries in a section of an initialization file is a value in the structure

If there is no value, returns an empty string.

Category

System functions

Function syntax

GetProfileSections(iniFile, [encoding])

See also

GetProfileStringSetProfileString

History

ColdFusion 11: Added the optional parameter, encoding.

ColdFusion MX: Added this function. 

Parameters

Parameter

Description

iniFile

Absolute path (drive, directory, filename, extension) of initialization file; for example, C:\boot.ini

encoding (Optional) Encoding of the initialization (ini) file. For instance "UTF-8" For a list of encodings, see cffile action = "read".

Example

GetProfileSections(expandPath("./russian.ini"),"UTF-8");

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy