Skip to content
Enhanced config file parser, which merges config files placed in several locations into one.
C Makefile M4 Objective-C Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


libeconf is a highly flexible and configureable library to parse and manage key=value configuration files. It reads configuration file snippets from different directories and builds the final configuration file for the application from it.

The first file is the vendor provided configuration file. There are two methods of overriding this vendor settings: copy the file from /usr/vendordir to /etc and modify the settings. Alternatively, a directory named file.suffix.d/ within /etc can be created, with drop-in files in the form name.suffix. This files contain only the changes of the specific settings the user is interested in. There can be serveral such drop-in files, they are processed in lexicographic order of their filename.

The first method is useful to override the complete configuration file with an own one, the vendor supplied configuration is ignored.

So, if /etc/example.suffix exists, /usr/vendor/example.suffix will not be read. The disadvantage is, that changes of the vendor configuration file are ignored and the user has to manually merge them.

The other method will continue to use /usr/vendor/example.suffix as base configuration file and merge all changes from /etc/example.suffix/*.suffix. So the user will automatically get improvements of the vendor, with the drawback, that they could be incompatible with the user made changes.

The list of files and directories read if no /etc/example.suffix file exists:

  • /usr/vendor/example.suffix
  • /usr/vendor/example.suffix.d/*.suffix
  • /etc/example.suffix.d/*.suffix

If a /etc/example.suffix files exists:

  • /etc/example.suffix
  • /etc/example.suffix.d/*.suffix
You can’t perform that action at this time.