Files
l2/test_write_file.sl

17 lines
321 B
Plaintext
Raw Normal View History

2025-12-18 11:32:35 +01:00
import stdlib/stdlib.sl
import stdlib/io.sl
: main
2025-12-19 20:23:26 +01:00
"/tmp/l2_test_write.txt" # push path (addr len)
"hello from write_file test\n" # push buf (addr len)
2025-12-18 11:32:35 +01:00
write_file
dup 0 > if
"wrote bytes: " puts
2025-12-19 20:23:26 +01:00
puti cr
2025-12-18 11:32:35 +01:00
0
exit
then
"write failed errno=" puts
2025-12-19 20:23:26 +01:00
puti cr
2025-12-18 11:32:35 +01:00
exit
2025-12-19 20:23:26 +01:00
;