Adding cat.

This commit is contained in:
Brad Nelson
2022-09-05 17:01:03 -07:00
parent cadc350d30
commit 3be3f23d8b

View File

@ -18,6 +18,15 @@
r> close-file drop r> close-file drop
; ;
: cat ( "path" -- )
parse r/o open-file if ." not found!" exit then { fh }
begin
here 80 fh read-file if drop exit fh close-file drop exit then
dup 0= if exit then
here swap type
again
;
internals definitions internals definitions
( Leave some room for growth of starting system. ) ( Leave some room for growth of starting system. )
0 value saving-base 0 value saving-base