Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Curious what features a plain-text file doesn't have that a registry would?


Most importantly, a stable API which can be concurrently used by multiple processes.

Getting/setting single values in a plain text config file is cumbersome and error-prone, and even if there's a library which is able to read that particular format, it often clobbers comments and formatting. For systems administration, you usually solve this by generating the entire config file from a template since nothing on the server should change your config files anyway.

However, on the desktop, many different application want to read and write keys. Tray applets, the system config panel, even your media player... They would inevitably conflict and you'd have to implement file-based locking.

Another topic: real-time notifications. If you modify the text size in the Gnome Control Panel, what happens is that the panel modifies the value in dconf and dconf sends a notification to all running Gnome applications. You could implement this using inotify, but you'd need code in each of your applications to open the config file, parse it and figure out which setting actually changed.

Single dconf lookups are really fast since everything is zero-copy and doesn't involve any syscalls. This is much faster than opening, reading and parsing config files.

dconf doesn't aim to replace all plain text config files. Storing the i3 or SSH configuration in dconf would be stupid (or even using dconf on a server to begin with).


> Getting/setting single values in a plain text config file is cumbersome and error-prone

What? The INI format is very simple and there are numerous libraries that handle it cleanly in any language.

> and even if there's a library which is able to read that particular format, it often clobbers comments and formatting.

What? These are primarily machine-readable configuration files. Why is formatting relevant? And how are comments relevant to dconf, since it uses a binary format anyway?

If a plain-text file isn't good enough, at least have the decency to use SQLite.


> However, on the desktop, many different application want to read and write keys. Tray applets, the system config panel, even your media player...

If your applications directly read and store configuration keys belonging to other applications, you have way worse problems in your architecture than configuration file format.


Configuration items like current theme or current default font are things, that all applications are interested in. If they want to have look and feel like the rest of the desktop, that is.


Yes, and read-only access requires no locking. Those settings should only be changed by the system control panel, not by random apps.


That opens another can of worms: What is system control panel: is that gnome control center? Or command line dconf tools? Or is that dconf-editor? Or one of the myriad tweak utilities?

Cut off one of these and brace for the whining, that gnome is dumbing everything down and locking up your settings.


> Most importantly, a stable API which can be concurrently used by multiple processes.

Lock files.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: