Re: [AD] al_make_recursive_directory

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-10-22, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> Can we get it for 5.0? Right now I need this:
> 
> ALLEGRO_CONFIG *get_config() {
>     ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_USER_SETTINGS_PATH);
>     ALLEGRO_PATH *path2 = al_create_path(NULL);
>     for (int i = 0; i < al_get_path_num_components(path); i++) {
>         al_path_append_component(path2, al_path_get_component(path, i));
>         al_make_directory(al_path_cstr(path2);
>     }
>     al_set_path_filename(path, "my_config.ini");
>     ALLEGRO_CONFIG *config = al_load_config_file(al_path_cstr(path, '/'));
>     if (!config) config = al_create_config();
>     al_destroy_path(path);
>     return config;
> }

Any reason not to just extend al_make_directory?

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/