Thoughts on using $HOME for __PATH__system-write-data__
Posted: Sat Nov 06, 2021 12:40 am
Hello,
On Linux it seems that Factorio uses as the value of "__PATH__system-write-data__", which is a little inconvenient. Could the value of "__PATH__system-write-data__" be changed to "$HOME/.factorio" or maybe something else instead? Changing it to "$HOME/.factorio" shouldn't break too much, since for most people I'm sure that $HOME is generally equal to getpwuid(getuid())->pw_dir anyway.
Typically, XDG's paths are preferable, but failing that I believe using $HOME is much preferred over getpwuid() since it's easier to work with.
What I'd like:
1. For Factorio to instead use XDG paths as "__PATH__system-write-data__" values: $XDG_CONFIG_HOME/factorio.ini for Factorio's config file, $XDG_CACHE_HOME/factorio for the "temp" folder and "crop-cache.dat", and $XDG_DATA_HOME/factorio for probably everything else? I think that's how it goes, I dunno. Somebody should spend more than 5 seconds thinking about good XDG compliance.
2. Don't like that? It is a big change, so here's a compromise: Use "$HOME/.factorio", falling back to getpwuid(getuid())->pw_dir if $HOME isn't defined.
P.S. Thank you so much for using /usr/share/factorio as "__PATH__system-read-data__"
On Linux it seems that Factorio uses
Code: Select all
getpwuid(getuid())->pw_dir + "/.factorio"
Typically, XDG's paths are preferable, but failing that I believe using $HOME is much preferred over getpwuid() since it's easier to work with.
What I'd like:
1. For Factorio to instead use XDG paths as "__PATH__system-write-data__" values: $XDG_CONFIG_HOME/factorio.ini for Factorio's config file, $XDG_CACHE_HOME/factorio for the "temp" folder and "crop-cache.dat", and $XDG_DATA_HOME/factorio for probably everything else? I think that's how it goes, I dunno. Somebody should spend more than 5 seconds thinking about good XDG compliance.
2. Don't like that? It is a big change, so here's a compromise: Use "$HOME/.factorio", falling back to getpwuid(getuid())->pw_dir if $HOME isn't defined.
P.S. Thank you so much for using /usr/share/factorio as "__PATH__system-read-data__"