Remove some code duplication in io.directories.unix

db4
Slava Pestov 2009-02-15 20:36:04 -06:00
parent 72e3210f33
commit 2fe934ba9d
1 changed files with 1 additions and 9 deletions

View File

@ -27,16 +27,8 @@ M: unix make-directory ( path -- )
M: unix delete-directory ( path -- )
normalize-path rmdir io-error ;
: (copy-file) ( from to -- )
dup parent-directory make-directories
binary <file-writer> [
swap binary <file-reader> [
swap stream-copy
] with-disposal
] with-disposal ;
M: unix copy-file ( from to -- )
[ normalize-path ] bi@ (copy-file) ;
[ normalize-path ] bi@ call-next-method ;
: with-unix-directory ( path quot -- )
[ opendir dup [ (io-error) ] unless ] dip