load_from_dirs


Description:

[ Version ( since = "2.14" ) ]
public bool load_from_dirs (string file, string[] search_dirs, out string full_path, KeyFileFlags flags) throws KeyFileError, FileError

Looks for a key file named file in the paths specified in search_dirs, loads the file into this and returns the file’s full path in full_path.

search_dirs are checked in the order listed in the array, with the highest priority directory listed first. Within each directory, file is looked for. If it’s not found, `-` characters in file are progressively replaced with directory separators to search subdirectories of the search directory. If the file has not been found after all `-` characters have been replaced, the next search directory in search_dirs is checked.

If the file could not be found in any of the search_dirs, [error@GLib.KeyFileError.NOT_FOUND] is returned. If the file is found but the OS returns an error when opening or reading the file, a [error@GLib.FileError] is returned. If there is a problem parsing the file, a [ error@GLib.KeyFileError] is returned.

Parameters:

this

an empty [struct@GLib.KeyFile] struct

file

a relative path to a filename to open and parse

search_dirs

`NULL`-terminated array of directories to search

full_path

return location for a string containing the full path of the file, or `NULL` to ignore

flags

flags from [flags@GLib.KeyFileFlags]

Returns:

true if a key file could be loaded, false otherwise