added bool value return to dir_create
This commit is contained in:
@@ -22,9 +22,9 @@ bool dir_exists(cstr path){
|
||||
#endif
|
||||
}
|
||||
|
||||
Result(void) dir_create(cstr path){
|
||||
Result(bool) dir_create(cstr path){
|
||||
if (dir_exists(path))
|
||||
return RESULT_VOID;
|
||||
return RESULT_VALUE(i, false);
|
||||
|
||||
char* parentDir= str_copy(path_dirname(str_from_cstr((void*)path))).data;
|
||||
try_void(dir_create(parentDir), free(parentDir));
|
||||
@@ -38,5 +38,5 @@ Result(void) dir_create(cstr path){
|
||||
return RESULT_ERROR_FMT("Can't create dicectory '%s': %s", path, strerror(errno));
|
||||
}
|
||||
|
||||
return RESULT_VOID;
|
||||
return RESULT_VALUE(i, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user