BLI: make BLI_make_existing_file() return true on success, and false on failure...

This commit is contained in:
Bastien Montagne 2017-04-17 12:04:38 +02:00
parent c89ed72048
commit 819064154c
2 changed files with 5 additions and 3 deletions

View File

@ -44,7 +44,7 @@ void BLI_setenv_if_new(const char *env, const char *val) ATTR_NONNULL(1);
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
void BLI_make_exist(char *dir);
void BLI_make_existing_file(const char *name);
bool BLI_make_existing_file(const char *name);
void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
void BLI_split_file_part(const char *string, char *file, const size_t filelen);

View File

@ -1234,14 +1234,16 @@ void BLI_make_exist(char *dir)
/**
* Ensures that the parent directory of *name exists.
*
* \return true on success (i.e. given path now exists on FS), false otherwise.
*/
void BLI_make_existing_file(const char *name)
bool BLI_make_existing_file(const char *name)
{
char di[FILE_MAX];
BLI_split_dir_part(name, di, sizeof(di));
/* make if the dir doesn't exist */
BLI_dir_create_recursive(di);
return BLI_dir_create_recursive(di);
}
/**