remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / basis / io / directories / hierarchy / hierarchy.factor
blob555f001bfccf2e43b5379567aba1fa033ecad33e
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
5 io.backend ;
6 IN: io.directories.hierarchy
8 : delete-tree ( path -- )
9     dup link-info directory? [
10         [ [ [ delete-tree ] each ] with-directory-files ]
11         [ delete-directory ]
12         bi
13     ] [ delete-file ] if ;
15 DEFER: copy-tree-into
17 : copy-tree ( from to -- )
18     normalize-path
19     over link-info type>>
20     {
21         { +symbolic-link+ [ copy-link ] }
22         { +directory+ [ '[ [ _ copy-tree-into ] each ] with-directory-files ] }
23         [ drop copy-file ]
24     } case ;
26 : copy-tree-into ( from to -- )
27     to-directory copy-tree ;
29 : copy-trees-into ( files to -- )
30     '[ _ copy-tree-into ] each ;