summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs8
1 files changed, 7 insertions, 1 deletions
diff --git a/jefs.fs b/jefs.fs
index 52f9cc4..778cc8a 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -194,7 +194,6 @@ variable hld
\ FUCK is BYE but it takes an error code. its called that because you call it when shit is fucked.
: fuck ( code -- ) 60 syscall1 ;
-\ TODO broken as shit
: (handler) >s0 error @ dup case
1 of ." stack underflow" endof
2 of ." word not found" endof
@@ -217,6 +216,13 @@ variable hld
2 constant enoent
9 constant ebadf
13 constant eacces
+
+: .errno ( err -- ) ?dup 0<> if case
+ enoent of ." no such file or directory" endof
+ ebadf of ." bad file descriptor" endof
+ eacces of ." permission denied" endof
+ ." mystery error (spooky)"
+ endcase cr then ;
\ }}}
\ FILE I/O {{{