duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 87585b9b7ee4ad286f5b03b56dfbda9a4c900004
parent a0297491db01d4e3ed113d112556ac00eecbe787
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Wed, 23 Nov 2022 11:10:36 -0500

doc/io: clarify and add missing methods

Diffstat:
Mfs/doc/io.txt | 9+++++++--
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 convenience words: :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