diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 9b049b0013..452b735619 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -948,3 +948,12 @@ bool config_get_entry_list_next(struct config_file_entry *entry) return true; } +bool config_file_exists(const char *path) +{ + config_file_t *config = config_file_new(path); + if (!config) + return false; + + config_file_free(config); + return true; +} diff --git a/libretro-common/include/file/config_file.h b/libretro-common/include/file/config_file.h index 344f0931c8..b13686cd95 100644 --- a/libretro-common/include/file/config_file.h +++ b/libretro-common/include/file/config_file.h @@ -158,6 +158,8 @@ bool config_file_write(config_file_t *conf, const char *path); * Does not close the file. */ void config_file_dump(config_file_t *conf, FILE *file); +bool config_file_exists(const char *path); + RETRO_END_DECLS #endif