3 ms·
Where is this data stored? The Wiki completely glosses over this subject, and I cannot tell from the code where it might save anything to (to be fair, I have ne
by badrequest 6y ago
Where is this data stored? The Wiki completely glosses over this subject, and I cannot tell from the code where it might save anything to (to be fair, I have never written in rust).
- deleted 6y ago[deleted]
- estebank 6y agoLooks like it is stored in Linux: /home/alice/.config/dijo/habit_record.json Windows: C:\Users\Alice\AppData\Roaming\nerdypepper\dijo\habit_record.json macOS: /Users/Alice/Library/Preferences/rs.nerdypepper.dijo/habit_record.json https://github.com/NerdyPepper/dijo/blob/master/src/utils.rs#L37-L48 https://github.com/NerdyPepper/dijo/blob/master/src/utils.rs... https://docs.rs/directories/0.8.5/directories/struct.ProjectDirs.html https://docs.rs/directories/0.8.5/directories/struct.Project...
- badrequest 6y agothank you!
- p0llard 6y agoI haven't run this, so perhaps the behaviour is different to what I'm expecting, but since it uses `XDG_DATA_HOME` (`data_dir` in the `directories` crate) I'd expect it to appear as /home/alice/.local/share/dijo/habit_record.json on XDG compliant Linux.
- StavrosK 6y agoThat's where it is for me, and not under ~/.config. It's a bit puzzling, because that's where I expected it to be.
- p0llard 6y agoIn general ~/.config is only for config; data should be in ~/.local/share, but a lot of programs get this wrong and abuse ~/.config using it for everything. Even worse are the programs which use it to cache runtime data; I should be able to add the entire ~/.config to a dotfiles repo without accidentally including personal data (other than that which might reasonably appear in a config file) or ephemeral data.
- StavrosK 6y agoFair enough, I guess this is actual program data rather than the config, you're right.
- alias-dev 6y agoThey use the 'directories' crate (https://docs.rs/directories/3.0.1/directories/struct.ProjectDirs.html#examples https://docs.rs/directories/3.0.1/directories/struct.Project...) to work out where the data directory should be, then write out to a json file. See 'src/utils.rs'
- float4 6y agoOn macOS/Linux you can always use opensnoop to find all files a process accesses. Helped me many times.