1 ! Copyright (C) 2004, 2008 Slava Pestov, Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors sequences combinators fry io.directories
4 io.pathnames io.files.info io.files.types io.files.links
6 IN: io.directories.hierarchy
8 : delete-tree ( path -- )
9 dup link-info directory? [
10 [ [ [ delete-tree ] each ] with-directory-files ]
13 ] [ delete-file ] if ;
17 : copy-tree ( from to -- )
21 { +symbolic-link+ [ copy-link ] }
22 { +directory+ [ '[ [ _ copy-tree-into ] each ] with-directory-files ] }
26 : copy-tree-into ( from to -- )
27 to-directory copy-tree ;
29 : copy-trees-into ( files to -- )
30 '[ _ copy-tree-into ] each ;