this post was submitted on 15 Aug 2023
14 points (100.0% liked)
Rust Programming
8161 readers
10 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Be sure to treat state and configuration separately. It doesn't matter on Windows as far as I know (they go in the same location), but on Linux those are supposed to go in different places.
Many programs get this wrong, and it is quite annoying as I track my config files in git. I don't want a diff just because the list of recently opened files changed! Or even worse: the program stores the last window size and position in the config file... (looking at you KDE!)
Here are some libraries I found to help with this in a cross platform way:
I haven't tried either, haven't written such a program yet.
As for how to store data, there are indeed many options, depending on your needs:
Without knowing more it is hard to give specific advise.
Thanks for the link to "dirs" - I wish I'd known about it before I implemented a (worse) version just using the home crate.