| Action | Correct Approach | Incorrect Approach | | :--- | :--- | :--- | | | AppData/Roaming (Win) / ~/.config (Linux) | Registry or Installation Folder | | Saving Logs | AppData/Local (Win) / ~/.cache (Linux) | Desktop or Documents | | Saving Cache | AppData/Local/Temp or Caches | Same folder as Database |
Data specific to a single computer (e.g., large temporary files, cached video).
[AppData Root]/ ├── config.json (User preferences) ├── data/ (Persistent user-generated content) │ └── profiles.db ├── cache/ (Temporary files, safe to delete) │ └── image_thumbnails/ ├── logs/ (Debugging and history logs) │ └── 2023-10-27.log └── temp/ (Short-lived files during runtime) application data folder
# Config Directory config_dir = user_config_dir("MyApp", "MyCompany")
du -sh ~/Library/Application\ Support/
Once you have the root folder, maintain a clean internal structure. Do not dump everything into the root directory.
In the early days of computing, programs often stored everything in their installation folder (e.g., C:\Program Files\App ). However, this caused problems: | Action | Correct Approach | Incorrect Approach
⚠️ Don’t delete folders for apps you still use—unless you want to reset them.