ref: 90d9a10c0234f5868c2e86882aae72fc931d53fd
dir: /lib/std/mkpath.myr/
use "syswrap" use "errno" pkg std = const mkpath : (p : byte[:] -> errno) ;; const mkpath = {p var st for var i = 0; i < p.len; i++ if p[i] == ('/' : byte) && i != 0 if !fexists(p[:i]) st = mkdir(p[:i], 0o755) if st != 0 -> st ;; ;; ;; ;; st = mkdir(p, 0o755) -> Enone }