Page 1 of 1

Location For User Config Files?

Posted: Thu Jan 20, 2022 11:58 am
by muleskinner
Hi,

I'm working on a module that needs to read xml config files created by users. I want to have it scan a directory at startup at present these config files as a popup list, kind of like presets I guess but more complex and unable to be created within the module itself.

Is there a standard location I should put a directory for these for Mac/PC and some kind of x-platform environment variable I can use to get its location or do I need to specify my own location for each platform?

cheers

Re: Location For User Config Files?

Posted: Sun Jan 23, 2022 11:23 am
by honki-bobo
Hi,

you could use a dotted folder in the users home directory to store your XML files and retrieve the home directory location from system properties, like

Code: Select all

String sep = System.getProperty("file.separator");
String xmlDir = System.getProperty("user.home") + sep + ".myXmlDir" + sep;
Best regards,
Martin