db4
Slava Pestov 2008-02-16 15:24:41 -06:00
parent 085b45b29d
commit a832b4d445
1 changed files with 5 additions and 4 deletions

View File

@ -143,12 +143,13 @@ M: pathname <=> [ pathname-string ] compare ;
: file-lines ( path -- seq ) <file-reader> lines ; : file-lines ( path -- seq ) <file-reader> lines ;
: file-contents ( path -- str ) : file-contents ( path -- str )
dup <file-reader> swap file-length <sbuf> [ stream-copy ] keep >string ; dup <file-reader> swap file-length <sbuf>
[ stream-copy ] keep >string ;
: with-file-writer ( path quot -- )
>r <file-reader> r> with-stream ; inline
: with-file-reader ( path quot -- ) : with-file-reader ( path quot -- )
>r <file-reader> r> with-stream ; inline
: with-file-writer ( path quot -- )
>r <file-writer> r> with-stream ; inline >r <file-writer> r> with-stream ; inline
: with-file-appender ( path quot -- ) : with-file-appender ( path quot -- )