[libbluray-devel] Find user data and cache dirs in linux(xdg), windows and darwin

Diego Elio Pettenò flameeyes at flameeyes.eu
Wed Mar 13 17:01:08 CET 2013


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
flameeyes at flameeyes.euhttp://blog.flameeyes.eu/


On Wed, Mar 13, 2013 at 10:34 AM, Jean-Baptiste Kempf <jb at videolan.org> 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
> libbluray-devel at videolan.org
> http://mailman.videolan.org/listinfo/libbluray-devel


More information about the libbluray-devel mailing list