summaryrefslogtreecommitdiff
path: root/lib/std/mkpath.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/mkpath.myr')
-rw-r--r--lib/std/mkpath.myr8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/mkpath.myr b/lib/std/mkpath.myr
index 61e2a72..22d1d3d 100644
--- a/lib/std/mkpath.myr
+++ b/lib/std/mkpath.myr
@@ -10,9 +10,11 @@ const mkpath = {p
for var i = 0; i < p.len; i++
if p[i] == ('/' : byte) && i != 0
- st = mkdir(p[:i], 0o755)
- if st != 0 && st != Eexist
- -> st
+ if !fexists(p[:i])
+ st = mkdir(p[:i], 0o755)
+ if st != 0
+ -> st
+ ;;
;;
;;
;;