Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way.
For the: Filesystem Hierarchy Standard
I should store my files at:
Temp files:
/var/temp/app_name/*or/temp/app_name/*Cache files:
/var/cache/app_name/*Config files:
~/.config/app_name/*Log files:
/var/log/app_name/*Data files (database, etc.):
???
Q1: Is that the right approach for the recent systems?
For the XDG standart that explained here:
Temp files:
???or/temp/app_name/*Cache files:
~/.cache/app_name/*Config files:
~/.config/app_name/*Log files:
???Data files (database, etc.):
???
I cant understand why we store a cache file in the ~/.cache. It doesn't make any sense to me because there was a built-in cache folder called /var/cache
In that case, I'm confused. Everywhere I investigate, there have been different approaches.
Q2: Where should we put the files (datas, logs, temps, configs, etc.) for a pure Linux distribution (which does not use $XDG) to create applications?
Q3: Some applications use the Linux structure, but some of use the XDG structure. How do they choose this? According to what situation? Do they use $XDG environment variables if we're using them?
According to the above situation, my env | grep -i "XDG" output:
XDG_VTNR=1
XDG_SESSION_ID=1
XDG_DATA_DIRS=/home/furkan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
P.S: I don't know the parts I'm showing with ???