Author: Virgil Dupras <firstname.lastname@example.org>
Date: Wed, 23 Nov 2022 11:10:36 -0500
doc/io: clarify and add missing methods
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/doc/io.txt b/fs/doc/io.txt
@@ -50,7 +50,12 @@ In addition to those device-specific words, all IO structures share these
:write ( a n hdl -- )
- Repeatedly call :writebuf until all requested bytes have been written.
+ Repeatedly call :writebuf until 'n' bytes have been written (coming from 'a')
+ Aborts if we can't write all bytes.
+:read ( a n hdl -- )
+ Repeatedly call :readbuf until 'n' bytes have been read (into buffer at 'a',
+ which of course must be big enough). Aborts if we can't read all bytes.
:getc ( hdl -- c )
Read 1 byte from hdl an return it. Advance position by 1 byte. Return -1 on
@@ -66,7 +71,7 @@ convenience words:
Set the putback value to c.
:readline ( hdl -- str-or-0 )
- read stdin for a maximum of STR_MAXSZ-1 characters until LF or EOF is
+ read hdl for a maximum of STR_MAXSZ-1 characters until LF or EOF is
encountered, then return a string representing that read line. The LF
character is not included. Aborts on LNSZ overflow. The string can be zero in
length if LF is encountered right away. When EOF is encountered in the middle