From 032204d951e191771ce6cd99ecf5118ee1e1dce5 Mon Sep 17 00:00:00 2001 From: Naren Ratan Date: Tue, 19 Nov 2019 00:20:31 +0000 Subject: Add file_io.f example --- examples/file_io.f | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/file_io.f 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 / +↓ ⍗ -- cgit 1.4.1-2-gfad0