File.StringReader
read
defn
(Fn [(Ref File a), Int] (Result String String))
(read file n)
Reads a string of exactly n characters from a file. This is a convenient wrapper that fixes the returntype of File.read to String.
read-string
defn
(Fn [(Ref File a), Int] (Result String String))
(read-string f len)
reads a string of exactly len characters from a file.
Returns a result containing the string on success, and an error if len is negative or if the file held fewer than len characters, in which case the characters that were read are discarded.
A success always holds len characters, but String.length reports fewer if any of them are NUL.