[Mac] Directory for config files: Preferences vs App Support?

38 views
Skip to first unread message

Vadim Zeitlin

unread,
Nov 22, 2016, 11:02:22 AM11/22/16
to wx-dev
Hello,

If I'm reading Apple file system programming guide (see
https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html)
correctly, wxFileConfig shouldn't create its files in ~/Library/Preferences,
which should only be written to by NSUserDefaults, but rather in
~/Library/Application Support/appname.

Is this really the right way to interpret it? And, if it is, is it worth
breaking the existing applications storing their configuration in
~/Library/Preferences by moving the config files under Application Support?
Or, alternatively, is it worth complicating wxFileConfig code to look under
Preferences first, but use Application Support for creating new files?

E.g. does Apple check that the application does not write to Preferences
directly for the applications distributed via App Store? If so, this would
be a sufficient impetus to do something about it. OTOH if it's alright to
write there, perhaps our effort would be better spent on providing a more
native (i.e. NSUserDefaults-based) wxConfig implementation and changing the
file format, rather than changing its location...

Thanks in advance for any information,
VZ

Václav Slavík

unread,
Nov 22, 2016, 11:44:09 AM11/22/16
to wx-...@googlegroups.com
Hi,

Is this really the right way to interpret it?

I suppose. But you should also never store user preferences outside of NSUserDefaults, so there’s that. IMHO wx is doing the right thing _in spirit_.

And, if it is, is it worth
breaking the existing applications storing their configuration in
~/Library/Preferences by moving the config files under Application Support?

No.

E.g. does Apple check that the application does not write to Preferences
directly for the applications distributed via App Store?

No. Apple can be bitchy about all sort of nonsense in review, but I never had any problem with anything in wx, this included.

If so, this would be a sufficient impetus to do something about it. OTOH if it's alright to
write there, perhaps our effort would be better spent on providing a more
native (i.e. NSUserDefaults-based) wxConfig implementation and changing the
file format, rather than changing its location…

Exactly.

Regards,
Václav



Reply all
Reply to author
Forward
0 new messages