As an exercise in making Protrekkr more Haiku-friendly, I’m trying to move the configuration file from ./ptk.cfg to ~/config/settings/protrekkr_config but it seems to be read-only. How am I doing this wrong? Code fragment follows:
// ------------------------------------------------------
// Set default configuration path
#if defined(__HAIKU__)
#define ALLOCATE_CONFIGNAME char *FileName = "~/config/settings/protrekkr_config";
#define GENERATE_CONFIGNAME
#else
#define ALLOCATE_CONFIGNAME char FileName[MAX_PATH];
#define GENERATE_CONFIGNAME sprintf(FileName, "%s" SLASH "ptk.cfg", ExePath);
#endif
// ------------------------------------------------------
// Save the configuration file
void Save_Config(void)
{
FILE *out;
char extension[10];
char Temph[MAX_PATH];
ALLOCATE_CONFIGNAME
int i;
int Real_Palette_Idx;
char KeyboardName[MAX_PATH];
signed char phony = -1;
sprintf(extension, "PROTCFGG");
Status_Box("Saving 'ptk.cfg'...");
GENERATE_CONFIGNAME
memset(KeyboardName, 0, sizeof(KeyboardName));
sprintf(KeyboardName, "%s", Keyboard_Name);
out = fopen(FileName, "wb");