add with-file-in with-file-out with-file-appender

db4
Doug Coleman 2008-02-06 19:36:53 -06:00
parent 8428f66933
commit 2a417f4a9c
1 changed files with 9 additions and 0 deletions

View File

@ -169,3 +169,12 @@ PRIVATE>
: file-contents ( path -- str )
dup <file-reader> swap file-length <sbuf> [ stream-copy ] keep >string ;
: with-file-in ( path quot -- )
>r <file-reader> r> with-stream ; inline
: with-file-out ( path quot -- )
>r <file-writer> r> with-stream ; inline
: with-file-appender ( path quot -- )
>r <file-appender> r> with-stream ; inline