Skip to main content

LoadConfigFile

This function was added in DSL 1

Description

Load a config file given a relative path.

A valid config object is always returned, even if it is missing. It will just behave like an empty config file.

tip

You can check if a config is missing using IsConfigMissing.

function LoadConfigFile(filename) --[[ ... ]] end

Parameters

  • filename - string - The relative path to the config file to load. If the file does not exist, an empty config object is returned.

Return Values

  • config: userdata - A config object.

Example

local config = LoadConfigFile("my_config.ini")
if IsConfigMissing(config) then
print("Config file is missing!")
else
print("Config file loaded successfully!")
end

See Also