diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-12 10:23:59 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-12 10:25:14 +0200 |
commit | 108a0454d05c744c4a05e298cfc8cbf157952414 (patch) | |
tree | ca99bed5d49eabfb644c3b1c0a397b1354efdaf3 /doc/ref/general/io.texi | |
parent | Change overarching structure of info document. (diff) | |
download | calp-108a0454d05c744c4a05e298cfc8cbf157952414.tar.gz calp-108a0454d05c744c4a05e298cfc8cbf157952414.tar.xz |
Rework file tree structure for info files.
Diffstat (limited to 'doc/ref/general/io.texi')
-rw-r--r-- | doc/ref/general/io.texi | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/ref/general/io.texi b/doc/ref/general/io.texi new file mode 100644 index 00000000..8c83ddcf --- /dev/null +++ b/doc/ref/general/io.texi @@ -0,0 +1,31 @@ +@node IO operations +@section 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 |