summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/syswrap+posixy.myr8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index d0c63c8..23b8e04 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -92,7 +92,13 @@ const dup2 = {ofd, nfd; -> check((sys.dup2((ofd : sys.fd), (nfd : sys.fd)) : fd)
/* path manipulation */
const mkdir = {path, mode; -> (sys.mkdir(path, mode) : errno)}
const chdir = {path; -> sys.chdir(path) == 0}
-const remove = {path; -> sys.unlink(path) == 0}
+const remove = {path;
+ if std.fisdir(path)
+ -> sys.rmdir(sys.cstring(path)) == 0
+ else
+ -> sys.unlink(path) == 0
+ ;;
+}
/* useful/portable bits of uname */
const getsysinfo = {si