io: path: implement deleting (empty) directories

This commit is contained in:
2025-08-09 19:40:02 +01:00
parent bcbd85372e
commit 655d8b1881

View File

@@ -237,7 +237,7 @@ enum b_status b_path_stat(const b_path *path, struct b_file_info *out)
enum b_status b_path_unlink(const b_path *path) enum b_status b_path_unlink(const b_path *path)
{ {
int err = unlink(b_string_ptr(path->pathstr)); int err = remove(b_string_ptr(path->pathstr));
return err == 0 ? B_SUCCESS : b_status_from_errno(errno, B_ERR_IO_FAILURE); return err == 0 ? B_SUCCESS : b_status_from_errno(errno, B_ERR_IO_FAILURE);
} }