issue with wxCONFIG_USE_SUBDIR

Carsten A. Arnholm arnholm at offline.no
Mon Feb 25 11:31:23 PST 2008


Hello,

I am using wxMSW (Win XP) and wxGTK 2.8.7 (Kubuntu 7.04)

On linux a wxConfig is created with style = wxCONFIG_USE_LOCAL_FILE | 
wxCONFIG_USE_SUBDIR

In 
http://www.wxwidgets.org/manuals/stable/wx_wxconfigbase.html#wxconfigbasector 
it says
"On non-VMS Unix systems, the default local configuration file is 
~/.appname. However, this path may be also used as user data directory (see 
wxStandardPaths::GetUserDataDir) if the application has several data files. 
In this case wxCONFIG_USE_SUBDIR flag, which changes the default local 
configuration file to ~/.appname/appname should be used."

It turns out that if the ~/.appname folder does not already exist, then 
saving of the wxConfig fails with an error. I had assumed that 
wxCONFIG_USE_SUBDIR implied that the folder would be created if it was 
missing, but that assumption appears to be incorrect? Is there a reason it 
does not create the folder?

If it has to be created by the application, is there an easy way to create 
the folder under "non-VMS Unix systems" that will not affect my windows 
build?

-- 
Carsten A. Arnholm
http://arnholm.org/
N59.776 E10.457 








More information about the wx-users mailing list