Skip to content

Commit 9f726c7

Browse files
committed
spork/stream: add make-stdin, make-stdout, and make-stderr
1 parent 79e9a40 commit 9f726c7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

spork/stream.janet

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@
2626
(when (not (empty? chunk))
2727
(yield chunk)))))
2828
(coro (fetch-lines @"")))
29+
30+
(defn make-stdin
31+
"Return a readable stream on /dev/stdin"
32+
[]
33+
(os/open "/dev/stdin" :r))
34+
35+
(defn make-stdout
36+
"Return a writable stream on /dev/stdout"
37+
[]
38+
(os/open "/dev/stdout" :w))
39+
40+
(defn make-stderr
41+
"Return a writable stream on /dev/stderr"
42+
[]
43+
(os/open "/dev/stderr" :w))

0 commit comments

Comments
 (0)