Skip to content

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

Open
@alifeee

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions