Hrm, the XDG data dir usage seems partially wrong, as it does not consult the system dir at all --- I would suggest looking at libxdg-basedir library for API examples of looking-for-file. Diego Elio Pettenò — Flameeyes [email protected] — http://blog.flameeyes.eu/
On Wed, Mar 13, 2013 at 10:34 AM, Jean-Baptiste Kempf <[email protected]> wrote: > On 13 Mar, hpi1 wrote : >> Find user data and cache dirs in linux(xdg), windows and darwin > > Just a remark, if you are using utf-8 char on Windows, you cannot pass > it normally to fopen, mkdir and such, but you need to pass them to _w* > equivalent. > >> + /* Get the "Application Data" folder for the user */ >> + if (S_OK == SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, >> + NULL, SHGFP_TYPE_CURRENT, wdir)) { >> + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, PATH_MAX, NULL, >> NULL); > > Why not mallocing appdir, with the size_len found with a prior call? > > Best regards, > > -- > Jean-Baptiste Kempf > http://www.jbkempf.com/ - +33 672 704 734 > Sent from my Electronic Device > _______________________________________________ > libbluray-devel mailing list > [email protected] > http://mailman.videolan.org/listinfo/libbluray-devel _______________________________________________ libbluray-devel mailing list [email protected] http://mailman.videolan.org/listinfo/libbluray-devel
