Decouple usage of filepath from os2

This commit is contained in:
Feoramund
2025-03-21 19:14:15 -04:00
parent abe0c30837
commit 4e7f54c565
12 changed files with 42 additions and 39 deletions
+2 -3
View File
@@ -3,7 +3,6 @@ package os2
import "base:runtime"
import "core:path/filepath"
import "core:sync"
import "core:sys/wasm/wasi"
@@ -35,11 +34,11 @@ _mkdir_all :: proc(path: string, perm: int) -> Error {
return .Exist
}
clean_path := filepath.clean(path, temp_allocator())
clean_path := clean_path(path, temp_allocator())
return internal_mkdir_all(clean_path)
internal_mkdir_all :: proc(path: string) -> Error {
dir, file := filepath.split(path)
dir, file := split_path(path)
if file != path && dir != "/" {
if len(dir) > 1 && dir[len(dir) - 1] == '/' {
dir = dir[:len(dir) - 1]