about summary refs log tree commit diff stats
path: root/examples/file_io.f
diff options
context:
space:
mode:
Diffstat (limited to 'examples/file_io.f')
-rw-r--r--examples/file_io.f10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/file_io.f b/examples/file_io.f
new file mode 100644
index 0000000..b9cce38
--- /dev/null
+++ b/examples/file_io.f
@@ -0,0 +1,10 @@
+/ Example file IO using syscalls /
+
+/ Open a file read only with open ⍐ syscall /
+0 H" input.txt" ↓ ⍐
+
+/ Read one byte with read ⍇ syscall /
+↑ 1 H ⌽ ⍇
+
+/ Close file with close ⍗ syscall /
+↓ ⍗