aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-11-12 03:38:24 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-11-12 03:39:04 +0100
commitb1a392ba44558ca1a1a6ae3e93682f9b544864f2 (patch)
tree863e64953621850d3147c72fbd11812f0d993744
parentAdd /everything.ics endpoint. (diff)
downloadcalp-b1a392ba44558ca1a1a6ae3e93682f9b544864f2.tar.gz
calp-b1a392ba44558ca1a1a6ae3e93682f9b544864f2.tar.xz
Document (hnh util io).
-rw-r--r--doc/ref/guile/util.texi31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/ref/guile/util.texi b/doc/ref/guile/util.texi
index f9e6527e..72463407 100644
--- a/doc/ref/guile/util.texi
+++ b/doc/ref/guile/util.texi
@@ -337,3 +337,34 @@ Generates a UUID-v4 string.
@defun uuid
Generates an implementation defined (but guaranteed valid) UUID.
@end defun
+
+@subsection IO
+
+Provided by module @code{(hnh util io)}.
+
+@defun open-input-port path
+@defunx open-output-port path
+Like @code{open-*-file}, but ``-'' gives @code{standard-@{input,output@}}.
+@end defun
+
+@defun read-lines port
+Return a list of all lines read from port.
+@end defun
+
+@defun with-atomic-output-to-file filename thunk
+Same functionality as the regular @var{with-output-to-file}, but
+with the difference that either everything is written, or nothing
+is written, and if anything is written it's all written atomicaly at
+once (the original file will never contain an intermidiate state).
+Does NOT handle race conditions between threads.
+
+propagates the return value of @var{thunk} upon successfully writing
+the file, and @code{#f} otherwise.
+@end defun
+
+@defun call-with-tmpfile proc [#:tmpl ``/tmp/file-XXXXXXX'']
+@end defun
+
+@defun read-file path
+Open file at path, and return its content as a string.
+@end defun