4 ms·
Sounds very much like how .ini files work and/or how regedit works on windows? :p Not a bad idea at all, but perhaps re-inventing a very old wheel?
by bboygravity 3y ago
Sounds very much like how .ini files work and/or how regedit works on windows? :p
Not a bad idea at all, but perhaps re-inventing a very old wheel?
- moron4hire 3y agoIt's not at all like INI files. INI files have field names and section delimiters in them. An INI files might be: [UI] DarkMode=1 Theme=solarized [Options] Indent=4 InventMode=tabs Whereas this file system config would have individual files per value. <user-home>/.config/<app-name>/UI/DarkMode.bool --> 1 It's a single byte file. You read the entire file contents and if it's not zero, it's true. The existence of the file tells you whether or not to use a default value. An INI file would have to be fully parsed before we know whether it contains a value for that config value. <user-home>/.config/<app-name>/UI/Theme.txt --> solarized You read the entire file contents, trim leading and trailing whitespace and toLower for good measure if you want, then validate against your list of installed themes. Done. No goofy JSON or YAML parser in site. And what reinvention is there? If you're just using a system that already exists, you're not reinventing anything.
- x-shadowban 3y agoSort of an homage to the windows registry, but it's not a "secret 3rd thing" it's just another folder.