aboutsummaryrefslogtreecommitdiff
path: root/module/hnh/util/io.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/hnh/util/io.scm')
-rw-r--r--module/hnh/util/io.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/hnh/util/io.scm b/module/hnh/util/io.scm
index d73a1de8..2fbad39f 100644
--- a/module/hnh/util/io.scm
+++ b/module/hnh/util/io.scm
@@ -1,11 +1,12 @@
(define-module (hnh util io)
:use-module ((hnh util) :select (begin1))
- :use-module ((ice-9 rdelim) :select (read-line))
+ :use-module ((ice-9 rdelim) :select (read-line read-string))
:export (open-input-port
open-output-port
read-lines
with-atomic-output-to-file
- call-with-tmpfile))
+ call-with-tmpfile
+ read-file))
(define (open-input-port str)
(if (string=? "-" str)
@@ -72,3 +73,6 @@
(begin1
(proc port filename)
(close-port port))))))
+
+(define (read-file path)
+ (call-with-input-file path read-string))