added macro RESULT_ERROR_FMT and some filesystem functions

This commit is contained in:
2025-08-04 16:03:08 +03:00
parent 961d00fdb0
commit 6d959fe8f5
4 changed files with 28 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ Result(void) dir_create(cstr path){
if(mkdir(path, 0777) == -1)
#endif
{
return RESULT_ERROR(sprintf_malloc(512, "can't create dicectory '%s'", path), true);
return RESULT_ERROR_FMT("Can't create dicectory '%s': %s", path, strerror(errno));
}
return RESULT_VOID;