Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work on Linux (wrong application directory) #19

Open
alifeee opened this issue Jan 9, 2024 · 0 comments
Open

doesn't work on Linux (wrong application directory) #19

alifeee opened this issue Jan 9, 2024 · 0 comments

Comments

@alifeee
Copy link
Owner

alifeee commented Jan 9, 2024

See https://www.reddit.com/r/factorio/comments/191qnmm/comment/kgxml1q/

Application directory is https://wiki.factorio.com/Application_directory

Logfile location is set by combining

char *homeDir = get_home_dir();
char *factorioLogfile = malloc(strlen(homeDir) + strlen(POSITION_INFO_PATH) + 1);

char *get_home_dir()
{
#ifdef _WIN32
char *appdata = getenv("APPDATA");
return appdata;
#else
char *homeDir = getenv("HOME");
if (!homeDir)
{
struct passwd *pwd = getpwuid(getuid());
if (pwd)
homeDir = pwd->pw_dir;
}
return homeDir;
#endif
}

#define POSITION_INFO_PATH "/Factorio/script-output/mumble_positional-audio_information.txt"

When running on Linux, the app directory should resolve to ".../.factorio/..." not ".../Factorio/..."

Moreso on Mac it should be "~/Library/Application Support/factorio" so more #ifdef's will be needed per-platform

This was referenced Jan 9, 2024
@alifeee alifeee mentioned this issue Feb 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant