| get-string-all(3scm) | Scheme Programmer's Manual | get-string-all(3scm) |
NAME
get-string-all - read characters up to the next end of file
LIBRARY
(import (rnrs)) ;R6RS (import (rnrs io ports)) ;R6RS
SYNOPSIS
(get-string-all textual-input-port)
DESCRIPTION
Reads from textual-input-port until an end of file, decoding characters in the same manner as get-string-n(3scm) and get-string-n!(3scm).
If characters are available before the end of file, a string containing all the characters decoded from that data are returned. If no character precedes the end of file, the end-of-file object is returned.
RETURN VALUES
Returns a single value; a string or the end-of-file object.
EXAMPLES
(call-with-port (open-input-file "/etc/hostname")
(lambda (p)
(get-string-all p)))
=> "darkstar\n"
COMPATIBILITY
This procedure is only present in R6RS.
ERRORS
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
- The wrong number of arguments was passed or an argument was outside its domain. In particular, textual-input-port must be an open textual input port.
- &i/o-read (R6RS)
- A read error occurred during an I/O operation.
- &i/o-decoding (R6RS)
- The textual-input-port is associated with a transcoder in the raise error handling mode and an invalid byte sequence was encountered.
- &i/o-port (R6RS)
- This condition specifies the port object related to an &i/o-read or &i/o-decoding condition.
SEE ALSO
get-string-n(3scm), get-string-n!(3scm), get-bytevector-all(3scm)
STANDARDS
R6RS
HISTORY
This procedure first appeared in R6RS as part of the reworked I/O system.
AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.
| 2023-07-23 |