updates to io.sl
This commit is contained in:
@@ -2,18 +2,16 @@ import stdlib/stdlib.sl
|
||||
import stdlib/io.sl
|
||||
|
||||
: main
|
||||
"hello from write_file test\n" # push buf (len addr)
|
||||
swap # -> (addr len) = buf_ptr buf_len
|
||||
"/tmp/l2_test_write.txt" # push path (len addr)
|
||||
swap # -> (addr len) = path_ptr path_len
|
||||
"/tmp/l2_test_write.txt" # push path (addr len)
|
||||
"hello from write_file test\n" # push buf (addr len)
|
||||
write_file
|
||||
dup 0 > if
|
||||
"wrote bytes: " puts
|
||||
puts
|
||||
puti cr
|
||||
0
|
||||
exit
|
||||
then
|
||||
"write failed errno=" puts
|
||||
puts
|
||||
puti cr
|
||||
exit
|
||||
;
|
||||
;
|
||||
Reference in New Issue
Block a user