io.files: temp-file

db4
Eduardo Cavazos 2008-02-21 22:08:03 -06:00
parent b2cc6914b6
commit 41ca620271
1 changed files with 8 additions and 0 deletions

View File

@ -154,3 +154,11 @@ M: pathname <=> [ pathname-string ] compare ;
: with-file-appender ( path quot -- )
>r <file-appender> r> with-stream ; inline
: temp-dir ( -- path )
"temp" resource-path
dup exists? not
[ dup make-directory ]
when ;
: temp-file ( name -- path ) temp-dir swap path+ ;