<x-tad-bigger>256 Constant max-line
Create line-buffer max-line 2 + allot
: scan-file ( addr u -- )
begin
line-buffer max-line fd-in read-line throw
while
>r 2dup line-buffer r> compare 0=
until
else
drop
then
2drop ;
read-line ( addr u1 fd -- u2 flag ior )</x-tad-bigger> reads up to u1 bytes into the buffer at addr, and returns the number of bytes read, a flag that is false when the end of file is reached, and an error code.
It would be nice to fix the limitation, but if not, then it would at least be advisable to change the example and list it as an environmental dependency.
DaR
smime.p7s
Description: S/MIME cryptographic signature
