The use of simple text files in the coding common to the respective operating system, such as ASCII or UTF-8 , is widespread , so that they can be processed with a wide variety of programs, e.g. B. any text editor or on the command line .
Configuration files can a. also be binary , compressed or encrypted . There are also programs that manage their configuration files completely themselves. In such cases, the user does not have to or cannot deal directly with the corresponding configuration file.
In principle, no special file format is specified - each program or the developers of a computer program determine how settings are saved. A very simple way of saving configuration options is to write them as variables in binary form as data in a file with a given name (and an absolute or relative path). However, this data is difficult to interpret outside of the program. So therefore a configuration file can be read outside of the program and changed, many programs use text files as configuration files that follow a specific syntax, with the disadvantage that the program this data interpret when reading ( English parse ) needs to make it binary into their Traced back to shape.
There are some standardized file formats that are popular for configuration files. This is not least due to the fact that there are numerous ready-made program libraries for reading in and parsing such file formats. The most common file formats include:
- INI (initialization file)
- YAML (YAML Ain't Markup Language)
- TOML (Tom's Obvious, Minimal Language)
- XML (Extensible Markup Language)
Distribution depending on the operating system
In principle, the file format used does not depend on the operating system , but applications often use the same formats as the operating system they are running on.
The initialization files ( ) were often used under Windows . The registration database ( English Registry ) of a Windows system is a configuration file. However, this file is in a binary format, which is why special applications and services are required to be able to open and edit it.
Unix-like operating systems
Unix-like operating systems such as Linux or macOS use many different formats, although it is important to ensure that these are text files such as ASCII. Binary formats are rather uncommon. Although files on Linux systems often have no file extension, configuration files sometimes have shortcut / file extensions such as
*.cfg. Apple often formats settings in macOS as a so-called property list with the file identifier
In Unix-like systems, applications usually independently store their own configuration files in the user directory (usually ) with a leading dot in the file name. The point means that the files are viewed as hidden and are not displayed by default when the directory content is output. Freedesktop.org but writes another location before you: or if this environment variable is not set: .
When an application is installed or by a system administrator, configuration files that apply to all users can also be
/etccreated in the directory . In macOS, the user-specific configuration files of applications are usually stored in. macOS saves settings that apply to all users, in addition to the directory in .
- Comparing the Mac OS X Property List to the Windows Registry , www.macforensicslab.com, accessed July 30, 2011
- XDG Base Directory Specification. Environment variables. In: freedesktop.org . November 24, 2010, accessed August 3, 2020 .