]> gitweb.factorcode.org Git - factor.git/commitdiff
io.directories: merge io.directories.search and io.directories.hierarchy.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Feb 2021 00:24:17 +0000 (18:24 -0600)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 26 Feb 2021 00:45:51 +0000 (18:45 -0600)
33 files changed:
basis/editors/notepad/notepad.factor
basis/help/lint/spaces/spaces.factor
basis/io/directories/directories-docs.factor
basis/io/directories/directories-tests.factor
basis/io/directories/directories.factor
basis/io/directories/hierarchy/authors.txt [deleted file]
basis/io/directories/hierarchy/hierarchy-docs.factor [deleted file]
basis/io/directories/hierarchy/hierarchy-tests.factor [deleted file]
basis/io/directories/hierarchy/hierarchy.factor [deleted file]
basis/io/directories/hierarchy/summary.txt [deleted file]
basis/io/directories/search/authors.txt [deleted file]
basis/io/directories/search/search-docs.factor [deleted file]
basis/io/directories/search/search-tests.factor [deleted file]
basis/io/directories/search/search.factor [deleted file]
basis/io/directories/search/summary.txt [deleted file]
basis/io/files/unique/unique-tests.factor
basis/io/files/unique/unique.factor
basis/io/monitors/recursive/recursive-tests.factor
basis/io/standard-paths/windows/windows.factor
basis/logging/logging-tests.factor
basis/tools/deploy/macosx/macosx.factor
basis/vocabs/metadata/resources/resources.factor
extra/codebook/codebook.factor
extra/git/git.factor
extra/id3/id3.factor
extra/mason/cleanup/cleanup.factor
extra/mason/git/git.factor
extra/mason/release/archive/archive.factor
extra/mason/release/tidy/tidy.factor
extra/mason/report/report-tests.factor
extra/tools/directory-to-file/directory-to-file.factor
extra/webapps/mason/docs-update/docs-update.factor
extra/webapps/mason/version/source/source.factor

index de381cf35cdd92b1e7aa5a1784ee4e0686d6d2c2..b60b878b8124e4fbbb9b1fd590d870c6ed5bd0e7 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays editors io.directories.search kernel namespaces
+USING: arrays editors io.directories kernel namespaces
 sequences windows.shell32 ;
 
 IN: editors.notepad
index 54dd5cfcdc887f78555dcb0c3e6a9319ffb71e0f..9c3e769992c0b6d382389802e3c5bfd9b70d603b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2017 Alexander Ilin.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays combinators.short-circuit formatting io
-io.directories.search io.encodings.utf8 io.files io.pathnames
+io.directories io.encodings.utf8 io.files io.pathnames
 kernel math namespaces prettyprint sequences ui.gadgets.panes
 vocabs.loader ;
 
index db49a4bdd0d873e88f304f631f526e20caaa12a4..753d56fb07c91e9d66a1573cc45c417f8e93c12b 100644 (file)
@@ -1,5 +1,5 @@
 USING: help.markup help.syntax io.files.private io.pathnames
-quotations ;
+quotations sequences ;
 IN: io.directories
 
 HELP: cwd
@@ -202,6 +202,167 @@ $nl
 }
 "On most operating systems, files can only be moved within the same file system. To move files between file systems, use " { $link copy-file } " followed by " { $link delete-file } " on the old name." ;
 
+HELP: +depth-first+
+{ $description "Method of directory traversal that fully recurses as far as possible before backtracking." } ;
+
+HELP: +breadth-first+
+{ $description "Method of directory traversal that explores each level of graph fully before moving to the next level." } ;
+
+HELP: traversal-method
+{ $var-description "Determines directory traversal method, either " { $link +depth-first+ } " or " { $link +breadth-first+ } "." } ;
+
+HELP: each-file
+{ $values
+    { "path" "a pathname string" } { "quot" quotation }
+}
+{ $description "Traverses a directory path recursively and calls the quotation on the full pathname of each file, in a breadth-first or depth-first " { $link traversal-method } "." }
+{ $examples
+    { $unchecked-example "USING: sequences io.directories ;"
+        "\"resource:misc\" [ . ] each-file"
+        "! Recursive directory listing prints here"
+    }
+} ;
+
+HELP: recursive-directory-files
+{ $values
+    { "path" "a pathname string" }
+    { "paths" { $sequence "pathname strings" } }
+}
+{ $description "Traverses a directory path recursively and returns a sequence of files, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: recursive-directory-entries
+{ $values
+    { "path" "a pathname string" }
+    { "directory-entries" { $sequence directory-entry } }
+}
+{ $description "Traverses a directory path recursively and returns a sequence of directory-entries, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: find-file
+{ $values
+    { "path" "a pathname string" } { "quot" quotation }
+    { "path/f" { $maybe "pathname string" } }
+}
+{ $description "Finds the first file in the input directory matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: find-file-in-directories
+{ $values
+    { "directories" "a sequence of pathnames" } { "quot" quotation }
+    { "path'/f" { $maybe "pathname string" } }
+}
+{ $description "Finds the first file in the input directories matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: find-files
+{ $values
+    { "path" "a pathname string" } { "quot" quotation }
+    { "paths" { $sequence "pathname strings" } }
+}
+{ $description "Recursively finds all files in the input directory matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: find-files-in-directories
+{ $values
+    { "directories" { $sequence "directory paths" } } { "quot" quotation }
+    { "paths/f" { $maybe "a sequence of pathname strings" } }
+}
+{ $description "Finds all files in the input directories matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
+
+HELP: find-files-by-extension
+{ $values
+    { "path" "a pathname string" } { "extension" "a file extension" }
+    { "seq" sequence }
+}
+{ $description "Searches a directory for all files with the given extension. File extension and filenames are converted to lower-case and compared using the " { $link tail? } " word. The file extension should contain the period." }
+{ $examples
+    { $code
+        "USING: io.directories ;"
+        "\"/\" \".mp3\" find-by-extension"
+    }
+} ;
+
+HELP: find-files-by-extensions
+{ $values
+    { "path" "a pathname string" } { "extensions" { $sequence "file extensions" } }
+    { "seq" sequence }
+}
+{ $description "Searches a directory for all files in the given list of extensions. File extensions and filenames are converted to lower-case and compared using the " { $link tail? } " word. File extensions should contain the period." }
+{ $examples
+    { $code
+        "USING: io.directories ;"
+        "\"/\" { \".jpg\" \".gif\" \".tiff\" \".png\" \".bmp\" } find-files-by-extensions"
+    }
+} ;
+
+{ find-file find-files find-file-in-directories find-files-in-directories } related-words
+
+ARTICLE: "io.directories.search" "Searching directories"
+"Traversing directories:"
+{ $subsections
+    recursive-directory-files
+    recursive-directory-entries
+    each-file
+    each-directory-entry
+}
+"Finding files by name:"
+{ $subsections
+    find-file
+    find-files
+    find-file-in-directories
+    find-files-in-directories
+}
+"Finding files by extension:"
+{ $subsections
+    find-files-by-extension
+    find-files-by-extensions
+} ;
+HELP: directory-tree-files
+{ $values { "path" "a pathname string" } { "seq" "a sequence of filenames" } }
+{ $description "Outputs a sequence of all files and subdirectories inside the directory named by " { $snippet "path" } " or recursively inside its subdirectories." } ;
+
+HELP: with-directory-tree-files
+{ $values { "path" "a pathname string" } { "quot" quotation } }
+{ $description "Calls the quotation with the recursive directory file names on the stack and with the directory set as the " { $link current-directory } ". Restores the current directory after the quotation is called." } ;
+
+HELP: delete-tree
+{ $values { "path" "a pathname string" } }
+{ $description "Deletes a file or directory, recursing into subdirectories." }
+{ $errors "Throws an error if the deletion fails." }
+{ $warning "Misuse of this word can lead to catastrophic data loss." } ;
+
+HELP: copy-tree
+{ $values { "from" "a pathname string" } { "to" "a pathname string" } }
+{ $description "Copies a directory tree recursively." }
+{ $notes "This operation attempts to preserve original file attributes, however not all attributes may be preserved." }
+{ $errors "Throws an error if the copy operation fails." } ;
+
+HELP: copy-tree-into
+{ $values { "from" "a pathname string" } { "to" "a directory pathname string" } }
+{ $description "Copies a directory tree to another directory, recursively." }
+{ $errors "Throws an error if the copy operation fails." } ;
+
+HELP: copy-trees-into
+{ $values { "files" "a sequence of pathname strings" } { "to" "a directory pathname string" } }
+{ $description "Copies a set of directory trees to another directory, recursively." }
+{ $errors "Throws an error if the copy operation fails." } ;
+
+ARTICLE: "io.directories.hierarchy" "Directory hierarchy manipulation"
+"There is a naming scheme used by " { $vocab-link "io.directories" } ". Operations for deleting and copying files come in two forms:"
+{ $list
+    { "Words named " { $snippet { $emphasis "operation" } "-file" } " which work on regular files only." }
+    { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files." }
+}
+"Listing directory trees recursively:"
+{ $subsections
+    directory-tree-files
+    with-directory-tree-files
+}
+"Deleting directory trees recursively:"
+{ $subsections delete-tree }
+"Copying directory trees recursively:"
+{ $subsections
+    copy-tree
+    copy-tree-into
+    copy-trees-into
+} ;
+
 ARTICLE: "io.directories" "Directory manipulation"
 "The " { $vocab-link "io.directories" } " vocabulary defines words for inspecting and manipulating directories."
 { $subsections
@@ -211,6 +372,8 @@ ARTICLE: "io.directories" "Directory manipulation"
     "io.directories.create"
     "delete-move-copy"
     "io.directories.hierarchy"
+    "io.directories.search"
 } ;
 
+
 ABOUT: "io.directories"
index caaf7ffb56413d74677cd7383b86778738364bca..4ac6406f7a80781cc880c845720aac64e5c3ecf2 100644 (file)
@@ -1,5 +1,4 @@
-USING: arrays destructors io io.directories
-io.directories.hierarchy io.encodings.ascii io.encodings.utf8
+USING: arrays destructors io io.directories io.encodings.ascii io.encodings.utf8
 io.files io.files.info io.launcher io.pathnames kernel sequences
 system tools.test ;
 
@@ -174,3 +173,140 @@ system tools.test ;
     ] unit-test
 
 ] with-test-directory
+
+{ t } [
+    [
+        10 [ "io.paths.test" "gogogo" unique-file ] replicate
+        "." [ ] find-files [ natural-sort ] same?
+    ] with-test-directory
+] unit-test
+
+{ f } [
+    { "omg you shoudnt have a directory called this" "or this" }
+    [ "asdfasdfasdfasdfasdf" tail? ] find-file-in-directories
+] unit-test
+
+{ f } [
+    { } [ "asdfasdfasdfasdfasdf" tail? ] find-file-in-directories
+] unit-test
+
+{ t } [
+    [
+        "the-head" "" unique-file drop
+        "." [ file-name "the-head" head? ] find-file string?
+    ] with-test-directory
+] unit-test
+
+{ t } [
+    [
+        { "foo" "bar" } {
+            [ [ make-directory ] each ]
+            [ [ "abcd" append-path touch-file ] each ]
+            [ [ file-name "abcd" = ] find-files-in-directories length 2 = ]
+            [ [ delete-tree ] each ]
+        } cleave
+    ] with-test-directory
+] unit-test
+
+{ t } [
+    "resource:core/math/integers/integers.factor"
+    [ "math.factor" tail? ] find-up-to-root >boolean
+] unit-test
+
+{ f } [
+    "resource:core/math/integers/integers.factor"
+    [ drop f ] find-up-to-root
+] unit-test
+
+[
+    {
+        "/a"
+        "/a/a"
+        "/a/a/a"
+        "/a/b"
+        "/a/b/a"
+        "/b"
+        "/b/a"
+        "/b/a/a"
+        "/b/b"
+        "/b/b/a"
+        "/c"
+        "/c/a"
+        "/c/a/a"
+        "/c/b"
+        "/c/b/a"
+    }
+    {
+        "/a"
+        "/b"
+        "/c"
+        "/a/a"
+        "/a/b"
+        "/b/a"
+        "/b/b"
+        "/c/a"
+        "/c/b"
+        "/a/a/a"
+        "/a/b/a"
+        "/b/a/a"
+        "/b/b/a"
+        "/c/a/a"
+        "/c/b/a"
+    }
+] [
+    [
+        "a" make-directory
+        "a/a" make-directory
+        "a/a/a" touch-file
+        "a/b" make-directory
+        "a/b/a" touch-file
+        "b" make-directory
+        "b/a" make-directory
+        "b/a/a" touch-file
+        "b/b" make-directory
+        "b/b/a" touch-file
+        "c" make-directory
+        "c/a" make-directory
+        "c/a/a" touch-file
+        "c/b" make-directory
+        "c/b/a" touch-file
+
+        +depth-first+ traversal-method [
+            "." recursive-directory-files
+            current-directory get '[ _ ?head drop ] map
+
+            ! preserve file traversal order, but sort
+            ! alphabetically for cross-platform testing
+            dup length 3 / group natural-sort
+            [ natural-sort ] map concat
+        ] with-variable
+
+        +breadth-first+ traversal-method [
+            "." recursive-directory-files
+            current-directory get '[ _ ?head drop ] map
+
+            ! preserve file traversal order, but sort
+            ! alphabetically for cross-platform testing
+            [ [ length ] bi@ = ] monotonic-split
+            [ natural-sort ] map concat
+        ] with-variable
+    ] with-test-directory
+] unit-test
+
+{ { "classes/tuple/tuple.factor" } } [
+    "resource:core" [
+        "." directory-tree-files [ "classes/tuple/tuple.factor" = ] filter
+    ] with-directory
+] unit-test
+
+{ { "classes/tuple" } } [
+    "resource:core" [
+        "." directory-tree-files [ "classes/tuple" = ] filter
+    ] with-directory
+] unit-test
+
+{ { "classes/tuple/tuple.factor" } } [
+    "resource:core" [
+        [ "classes/tuple/tuple.factor" = ] filter
+    ] with-directory-tree-files
+] unit-test
index 401e4a894a7d1c3f2f65122827f4d507c8e211e9..81e7ad1ec813825317ef4244e9832562b02e3797 100644 (file)
@@ -1,8 +1,11 @@
 ! Copyright (C) 2004, 2008 Slava Pestov, Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators combinators.short-circuit
-continuations destructors fry io io.backend io.encodings.binary
-io.files io.pathnames kernel namespaces sequences system vocabs ;
+USING: accessors arrays assocs combinators
+combinators.short-circuit continuations deques destructors
+dlists fry io io.backend io.encodings.binary io.files
+io.files.info io.files.links io.files.types io.pathnames kernel
+kernel.private make math namespaces sequences sorting strings
+system unicode vocabs ;
 IN: io.directories
 
 : set-current-directory ( path -- )
@@ -57,6 +60,8 @@ HOOK: (directory-entries) os ( path -- seq )
 : with-directory-files ( path quot -- )
     '[ "" directory-files @ ] with-directory ; inline
 
+! Finding directories
+
 : qualified-directory-entries ( path -- seq )
     absolute-path
     dup directory-entries [ [ append-path ] change-name ] with map! ;
@@ -71,6 +76,138 @@ HOOK: (directory-entries) os ( path -- seq )
 : with-qualified-directory-entries ( path quot -- )
     '[ "" qualified-directory-entries @ ] with-directory ; inline
 
+SYMBOL: traversal-method
+
+SYMBOLS: +depth-first+ +breadth-first+ ;
+
+traversal-method [ +depth-first+ ] initialize
+
+<PRIVATE
+
+TUPLE: directory-iterator
+{ path string }
+{ bfs boolean }
+{ queue dlist } ;
+
+: push-directory-entries ( path iter -- )
+    { directory-iterator } declare
+    [ [ qualified-directory-entries ] [ 2drop f ] recover ] dip
+    [ bfs>> [ [ <reversed> ] unless ] keep ]
+    [ queue>> swap '[ _ _ [ push-front ] [ push-back ] if ] each ] bi ;
+
+: <directory-iterator> ( path bfs? -- iter )
+    <dlist> directory-iterator boa
+    dup path>> over push-directory-entries ;
+
+: next-directory-entry ( iter -- directory-entry/f )
+    { directory-iterator } declare
+    dup queue>> deque-empty? [ drop f ] [
+        dup queue>> pop-back
+        dup directory?
+        [ [ name>> swap push-directory-entries ] keep ]
+        [ nip ] if
+    ] if ;
+
+:: iterate-directory-entries ( ... iter quot: ( ... obj -- ... obj ) -- ... directory-entry/f )
+    iter next-directory-entry [
+        quot call
+        [ iter quot iterate-directory-entries ] unless*
+    ] [
+        f
+    ] if* ; inline recursive
+
+: iterate-directory ( iter quot -- path/f )
+    [ name>> ] prepose iterate-directory-entries ; inline
+
+: bfs? ( -- bfs? )
+    traversal-method get {
+        { +breadth-first+ [ t ] }
+        { +depth-first+ [ f ] }
+    } case ; inline
+
+: setup-traversal ( path quot -- iter quot' )
+    [ bfs? <directory-iterator> ] dip [ f ] compose ; inline
+
+PRIVATE>
+
+: each-file ( ... path quot: ( ... name -- ... ) -- ... )
+    setup-traversal iterate-directory drop ; inline
+
+: each-directory-entry ( path quot: ( ... entry -- ... ) -- )
+    setup-traversal iterate-directory-entries drop ; inline
+
+: recursive-directory-files ( path -- paths )
+    [ ] collector [ each-file ] dip ;
+
+: recursive-directory-entries ( path -- directory-entries )
+    [ ] collector [ each-directory-entry ] dip ;
+
+: find-file ( path quot: ( ... name -- ... ? ) -- path/f )
+    [ bfs? <directory-iterator> ] dip
+    '[ _ keep and ] iterate-directory ; inline
+
+: find-files ( path quot: ( ... name -- ... ? ) -- paths )
+    selector [ each-file ] dip ; inline
+
+ERROR: sequence-expected obj ;
+
+: ensure-sequence-of-directories ( obj -- seq )
+    dup string? [ 1array ] when
+    dup sequence? [ sequence-expected ] unless ;
+
+: find-file-in-directories ( directories quot: ( ... name -- ... ? ) -- path'/f )
+    [ ensure-sequence-of-directories ] dip
+    '[ _ find-file ] map-find drop ; inline
+
+: find-files-in-directories ( directories quot: ( ... name -- ... ? ) -- paths/f )
+    [ ensure-sequence-of-directories ] dip
+    '[ _ find-files ] map concat ; inline
+
+: ?parent-directory ( path -- path'/f )
+    dup parent-directory 2dup = [ 2drop f ] [ nip ] if ;
+
+: containing-directory ( path -- path' )
+    dup file-info directory? [ parent-directory ] unless ;
+
+: ?qualified-directory-files ( path -- seq )
+    [ qualified-directory-files ]
+    [ drop ?parent-directory [ ?qualified-directory-files ] [ f ] if* ] recover ;
+
+: (find-up-to-root) ( path quot: ( path -- ? ) -- obj )
+    [ [ ?qualified-directory-files ] dip find swap ] 2keep rot [
+        2drop
+    ] [
+        [ nip ?parent-directory ] dip over
+        [ (find-up-to-root) ] [ 2drop f ] if
+    ] if ; inline recursive
+
+: find-up-to-root ( path quot: ( path -- ? ) -- obj )
+    [ normalize-path containing-directory ] dip (find-up-to-root) ; inline
+
+: link-size/0 ( path -- n )
+    [ link-info size-on-disk>> ] [ 2drop 0 ] recover ;
+
+: directory-size ( path -- n )
+    0 swap [ link-size/0 + ] each-file ;
+
+: directory-usage ( path -- assoc )
+    [
+        [
+            [ name>> dup ] [ directory? ] bi
+            [ directory-size ] [ link-size/0 ] if
+        ] { } map>assoc
+    ] with-qualified-directory-entries sort-values ;
+
+: find-files-by-extensions ( path extensions -- seq )
+    [ >lower ] map
+    '[ >lower _ [ tail? ] with any? ] find-files ;
+
+: find-files-by-extension ( path extension -- seq )
+    1array find-files-by-extensions ;
+
+: find-files-larger-than ( path size -- seq )
+    '[ link-info size>> _ > ] find-files ;
+
 ! Touching files
 HOOK: touch-file io-backend ( path -- )
 
@@ -111,6 +248,47 @@ M: object copy-file
 : copy-files-into ( files to -- )
     '[ _ copy-file-into ] each ;
 
+<PRIVATE
+
+: directory-tree-files% ( path prefix -- )
+    [ dup directory-entries ] dip '[
+        [ name>> [ append-path ] [ _ prepend-path ] bi ]
+        [ directory? ] bi over ,
+        [ directory-tree-files% ] [ 2drop ] if
+    ] with each ;
+
+PRIVATE>
+
+: directory-tree-files ( path -- seq )
+    [ "" directory-tree-files% ] { } make ;
+
+: with-directory-tree-files ( path quot -- )
+    '[ "" directory-tree-files @ ] with-directory ; inline
+
+: delete-tree ( path -- )
+    dup link-info directory? [
+        [ [ [ delete-tree ] each ] with-directory-files ]
+        [ delete-directory ]
+        bi
+    ] [ delete-file ] if ;
+
+DEFER: copy-trees-into
+
+: copy-tree ( from to -- )
+    normalize-path
+    over link-info type>>
+    {
+        { +symbolic-link+ [ copy-link ] }
+        { +directory+ [ '[ _ copy-trees-into ] with-directory-files ] }
+        [ drop copy-file ]
+    } case ;
+
+: copy-tree-into ( from to -- )
+    to-directory copy-tree ;
+
+: copy-trees-into ( files to -- )
+    '[ _ copy-tree-into ] each ;
+
 {
     { [ os unix? ] [ "io.directories.unix" require ] }
     { [ os windows? ] [ "io.directories.windows" require ] }
diff --git a/basis/io/directories/hierarchy/authors.txt b/basis/io/directories/hierarchy/authors.txt
deleted file mode 100644 (file)
index 1901f27..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
diff --git a/basis/io/directories/hierarchy/hierarchy-docs.factor b/basis/io/directories/hierarchy/hierarchy-docs.factor
deleted file mode 100644 (file)
index 389fd08..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-USING: help.markup help.syntax quotations io.pathnames ;
-IN: io.directories.hierarchy
-
-HELP: directory-tree-files
-{ $values { "path" "a pathname string" } { "seq" "a sequence of filenames" } }
-{ $description "Outputs a sequence of all files and subdirectories inside the directory named by " { $snippet "path" } " or recursively inside its subdirectories." } ;
-
-HELP: with-directory-tree-files
-{ $values { "path" "a pathname string" } { "quot" quotation } }
-{ $description "Calls the quotation with the recursive directory file names on the stack and with the directory set as the " { $link current-directory } ". Restores the current directory after the quotation is called." } ;
-
-HELP: delete-tree
-{ $values { "path" "a pathname string" } }
-{ $description "Deletes a file or directory, recursing into subdirectories." }
-{ $errors "Throws an error if the deletion fails." }
-{ $warning "Misuse of this word can lead to catastrophic data loss." } ;
-
-HELP: copy-tree
-{ $values { "from" "a pathname string" } { "to" "a pathname string" } }
-{ $description "Copies a directory tree recursively." }
-{ $notes "This operation attempts to preserve original file attributes, however not all attributes may be preserved." }
-{ $errors "Throws an error if the copy operation fails." } ;
-
-HELP: copy-tree-into
-{ $values { "from" "a pathname string" } { "to" "a directory pathname string" } }
-{ $description "Copies a directory tree to another directory, recursively." }
-{ $errors "Throws an error if the copy operation fails." } ;
-
-HELP: copy-trees-into
-{ $values { "files" "a sequence of pathname strings" } { "to" "a directory pathname string" } }
-{ $description "Copies a set of directory trees to another directory, recursively." }
-{ $errors "Throws an error if the copy operation fails." } ;
-
-ARTICLE: "io.directories.hierarchy" "Directory hierarchy manipulation"
-"The " { $vocab-link "io.directories.hierarchy" } " vocabulary defines words for operating on directory hierarchies recursively."
-$nl
-"There is a naming scheme used by " { $vocab-link "io.directories" } " and " { $vocab-link "io.directories.hierarchy" } ". Operations for deleting and copying files come in two forms:"
-{ $list
-    { "Words named " { $snippet { $emphasis "operation" } "-file" } " which work on regular files only." }
-    { "Words named " { $snippet { $emphasis "operation" } "-tree" } " works on directory trees recursively, and also accepts regular files." }
-}
-"Listing directory trees recursively:"
-{ $subsections
-    directory-tree-files
-    with-directory-tree-files
-}
-"Deleting directory trees recursively:"
-{ $subsections delete-tree }
-"Copying directory trees recursively:"
-{ $subsections
-    copy-tree
-    copy-tree-into
-    copy-trees-into
-} ;
-
-ABOUT: "io.directories.hierarchy"
diff --git a/basis/io/directories/hierarchy/hierarchy-tests.factor b/basis/io/directories/hierarchy/hierarchy-tests.factor
deleted file mode 100644 (file)
index 3157731..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-USING: io.directories io.directories.hierarchy kernel
-sequences tools.test ;
-
-{ { "classes/tuple/tuple.factor" } } [
-    "resource:core" [
-        "." directory-tree-files [ "classes/tuple/tuple.factor" = ] filter
-    ] with-directory
-] unit-test
-
-{ { "classes/tuple" } } [
-    "resource:core" [
-        "." directory-tree-files [ "classes/tuple" = ] filter
-    ] with-directory
-] unit-test
-
-{ { "classes/tuple/tuple.factor" } } [
-    "resource:core" [
-        [ "classes/tuple/tuple.factor" = ] filter
-    ] with-directory-tree-files
-] unit-test
diff --git a/basis/io/directories/hierarchy/hierarchy.factor b/basis/io/directories/hierarchy/hierarchy.factor
deleted file mode 100644 (file)
index 663e2c8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-! Copyright (C) 2004, 2008 Slava Pestov, Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays kernel sequences combinators fry
-io.directories io.pathnames io.files.info io.files.types
-io.files.links io.backend make ;
-IN: io.directories.hierarchy
-
-<PRIVATE
-
-: directory-tree-files% ( path prefix -- )
-    [ dup directory-entries ] dip '[
-        [ name>> [ append-path ] [ _ prepend-path ] bi ]
-        [ directory? ] bi over ,
-        [ directory-tree-files% ] [ 2drop ] if
-    ] with each ;
-
-PRIVATE>
-
-: directory-tree-files ( path -- seq )
-    [ "" directory-tree-files% ] { } make ;
-
-: with-directory-tree-files ( path quot -- )
-    '[ "" directory-tree-files @ ] with-directory ; inline
-
-: delete-tree ( path -- )
-    dup link-info directory? [
-        [ [ [ delete-tree ] each ] with-directory-files ]
-        [ delete-directory ]
-        bi
-    ] [ delete-file ] if ;
-
-DEFER: copy-trees-into
-
-: copy-tree ( from to -- )
-    normalize-path
-    over link-info type>>
-    {
-        { +symbolic-link+ [ copy-link ] }
-        { +directory+ [ '[ _ copy-trees-into ] with-directory-files ] }
-        [ drop copy-file ]
-    } case ;
-
-: copy-tree-into ( from to -- )
-    to-directory copy-tree ;
-
-: copy-trees-into ( files to -- )
-    '[ _ copy-tree-into ] each ;
diff --git a/basis/io/directories/hierarchy/summary.txt b/basis/io/directories/hierarchy/summary.txt
deleted file mode 100644 (file)
index 3480f88..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deleting and copying directory hierarchies
diff --git a/basis/io/directories/search/authors.txt b/basis/io/directories/search/authors.txt
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/basis/io/directories/search/search-docs.factor b/basis/io/directories/search/search-docs.factor
deleted file mode 100644 (file)
index e0ef7cc..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: help.markup help.syntax io.directories kernel quotations
-sequences ;
-IN: io.directories.search
-
-HELP: +depth-first+
-{ $description "Method of directory traversal that fully recurses as far as possible before backtracking." } ;
-
-HELP: +breadth-first+
-{ $description "Method of directory traversal that explores each level of graph fully before moving to the next level." } ;
-
-HELP: traversal-method
-{ $var-description "Determines directory traversal method, either " { $link +depth-first+ } " or " { $link +breadth-first+ } "." } ;
-
-HELP: each-file
-{ $values
-    { "path" "a pathname string" } { "quot" quotation }
-}
-{ $description "Traverses a directory path recursively and calls the quotation on the full pathname of each file, in a breadth-first or depth-first " { $link traversal-method } "." }
-{ $examples
-    { $unchecked-example "USING: sequences io.directories.search ;"
-        "\"resource:misc\" [ . ] each-file"
-        "! Recursive directory listing prints here"
-    }
-} ;
-
-HELP: recursive-directory-files
-{ $values
-    { "path" "a pathname string" }
-    { "paths" { $sequence "pathname strings" } }
-}
-{ $description "Traverses a directory path recursively and returns a sequence of files, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: recursive-directory-entries
-{ $values
-    { "path" "a pathname string" }
-    { "directory-entries" { $sequence directory-entry } }
-}
-{ $description "Traverses a directory path recursively and returns a sequence of directory-entries, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: find-file
-{ $values
-    { "path" "a pathname string" } { "quot" quotation }
-    { "path/f" { $maybe "pathname string" } }
-}
-{ $description "Finds the first file in the input directory matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: find-file-in-directories
-{ $values
-    { "directories" "a sequence of pathnames" } { "quot" quotation }
-    { "path'/f" { $maybe "pathname string" } }
-}
-{ $description "Finds the first file in the input directories matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: find-files
-{ $values
-    { "path" "a pathname string" } { "quot" quotation }
-    { "paths" { $sequence "pathname strings" } }
-}
-{ $description "Recursively finds all files in the input directory matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: find-files-in-directories
-{ $values
-    { "directories" { $sequence "directory paths" } } { "quot" quotation }
-    { "paths/f" { $maybe "a sequence of pathname strings" } }
-}
-{ $description "Finds all files in the input directories matching the predicate quotation, in a breadth-first or depth-first " { $link traversal-method } "." } ;
-
-HELP: find-files-by-extension
-{ $values
-    { "path" "a pathname string" } { "extension" "a file extension" }
-    { "seq" sequence }
-}
-{ $description "Searches a directory for all files with the given extension. File extension and filenames are converted to lower-case and compared using the " { $link tail? } " word. The file extension should contain the period." }
-{ $examples
-    { $code
-        "USING: io.directories.search ;"
-        "\"/\" \".mp3\" find-by-extension"
-    }
-} ;
-
-HELP: find-files-by-extensions
-{ $values
-    { "path" "a pathname string" } { "extensions" { $sequence "file extensions" } }
-    { "seq" sequence }
-}
-{ $description "Searches a directory for all files in the given list of extensions. File extensions and filenames are converted to lower-case and compared using the " { $link tail? } " word. File extensions should contain the period." }
-{ $examples
-    { $code
-        "USING: io.directories.search ;"
-        "\"/\" { \".jpg\" \".gif\" \".tiff\" \".png\" \".bmp\" } find-files-by-extensions"
-    }
-} ;
-
-{ find-file find-files find-file-in-directories find-files-in-directories } related-words
-
-ARTICLE: "io.directories.search" "Searching directories"
-"The " { $vocab-link "io.directories.search" } " vocabulary contains words used for recursively iterating over a directory and for finding files in a directory tree." $nl
-"Traversing directories:"
-{ $subsections
-    recursive-directory-files
-    recursive-directory-entries
-    each-file
-    each-directory-entry
-}
-"Finding files by name:"
-{ $subsections
-    find-file
-    find-files
-    find-file-in-directories
-    find-files-in-directories
-}
-"Finding files by extension:"
-{ $subsections
-    find-files-by-extension
-    find-files-by-extensions
-} ;
-
-ABOUT: "io.directories.search"
diff --git a/basis/io/directories/search/search-tests.factor b/basis/io/directories/search/search-tests.factor
deleted file mode 100644 (file)
index 62c8105..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-USING: combinators fry grouping io.directories
-io.directories.hierarchy io.directories.search io.files.unique
-io.pathnames kernel math namespaces sequences sorting splitting
-splitting.monotonic strings tools.test ;
-
-{ t } [
-    [
-        10 [ "io.paths.test" "gogogo" unique-file ] replicate
-        "." [ ] find-files [ natural-sort ] same?
-    ] with-test-directory
-] unit-test
-
-{ f } [
-    { "omg you shoudnt have a directory called this" "or this" }
-    [ "asdfasdfasdfasdfasdf" tail? ] find-file-in-directories
-] unit-test
-
-{ f } [
-    { } [ "asdfasdfasdfasdfasdf" tail? ] find-file-in-directories
-] unit-test
-
-{ t } [
-    [
-        "the-head" "" unique-file drop
-        "." [ file-name "the-head" head? ] find-file string?
-    ] with-test-directory
-] unit-test
-
-{ t } [
-    [
-        { "foo" "bar" } {
-            [ [ make-directory ] each ]
-            [ [ "abcd" append-path touch-file ] each ]
-            [ [ file-name "abcd" = ] find-files-in-directories length 2 = ]
-            [ [ delete-tree ] each ]
-        } cleave
-    ] with-test-directory
-] unit-test
-
-{ t } [
-    "resource:core/math/integers/integers.factor"
-    [ "math.factor" tail? ] find-up-to-root >boolean
-] unit-test
-
-{ f } [
-    "resource:core/math/integers/integers.factor"
-    [ drop f ] find-up-to-root
-] unit-test
-
-[
-    {
-        "/a"
-        "/a/a"
-        "/a/a/a"
-        "/a/b"
-        "/a/b/a"
-        "/b"
-        "/b/a"
-        "/b/a/a"
-        "/b/b"
-        "/b/b/a"
-        "/c"
-        "/c/a"
-        "/c/a/a"
-        "/c/b"
-        "/c/b/a"
-    }
-    {
-        "/a"
-        "/b"
-        "/c"
-        "/a/a"
-        "/a/b"
-        "/b/a"
-        "/b/b"
-        "/c/a"
-        "/c/b"
-        "/a/a/a"
-        "/a/b/a"
-        "/b/a/a"
-        "/b/b/a"
-        "/c/a/a"
-        "/c/b/a"
-    }
-] [
-    [
-        "a" make-directory
-        "a/a" make-directory
-        "a/a/a" touch-file
-        "a/b" make-directory
-        "a/b/a" touch-file
-        "b" make-directory
-        "b/a" make-directory
-        "b/a/a" touch-file
-        "b/b" make-directory
-        "b/b/a" touch-file
-        "c" make-directory
-        "c/a" make-directory
-        "c/a/a" touch-file
-        "c/b" make-directory
-        "c/b/a" touch-file
-
-        +depth-first+ traversal-method [
-            "." recursive-directory-files
-            current-directory get '[ _ ?head drop ] map
-
-            ! preserve file traversal order, but sort
-            ! alphabetically for cross-platform testing
-            dup length 3 / group natural-sort
-            [ natural-sort ] map concat
-        ] with-variable
-
-        +breadth-first+ traversal-method [
-            "." recursive-directory-files
-            current-directory get '[ _ ?head drop ] map
-
-            ! preserve file traversal order, but sort
-            ! alphabetically for cross-platform testing
-            [ [ length ] bi@ = ] monotonic-split
-            [ natural-sort ] map concat
-        ] with-variable
-    ] with-test-directory
-] unit-test
diff --git a/basis/io/directories/search/search.factor b/basis/io/directories/search/search.factor
deleted file mode 100644 (file)
index 7ea7469..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs combinators continuations deques
-dlists fry io.backend io.directories io.files.info io.pathnames
-kernel kernel.private locals math namespaces sequences sorting
-strings system unicode vocabs ;
-IN: io.directories.search
-
-SYMBOL: traversal-method
-
-SYMBOLS: +depth-first+ +breadth-first+ ;
-
-traversal-method [ +depth-first+ ] initialize
-
-<PRIVATE
-
-TUPLE: directory-iterator
-{ path string }
-{ bfs boolean }
-{ queue dlist } ;
-
-: push-directory-entries ( path iter -- )
-    { directory-iterator } declare
-    [ [ qualified-directory-entries ] [ 2drop f ] recover ] dip
-    [ bfs>> [ [ <reversed> ] unless ] keep ]
-    [ queue>> swap '[ _ _ [ push-front ] [ push-back ] if ] each ] bi ;
-
-: <directory-iterator> ( path bfs? -- iter )
-    <dlist> directory-iterator boa
-    dup path>> over push-directory-entries ;
-
-: next-directory-entry ( iter -- directory-entry/f )
-    { directory-iterator } declare
-    dup queue>> deque-empty? [ drop f ] [
-        dup queue>> pop-back
-        dup directory?
-        [ [ name>> swap push-directory-entries ] keep ]
-        [ nip ] if
-    ] if ;
-
-:: iterate-directory-entries ( ... iter quot: ( ... obj -- ... obj ) -- ... directory-entry/f )
-    iter next-directory-entry [
-        quot call
-        [ iter quot iterate-directory-entries ] unless*
-    ] [
-        f
-    ] if* ; inline recursive
-
-: iterate-directory ( iter quot -- path/f )
-    [ name>> ] prepose iterate-directory-entries ; inline
-
-: bfs? ( -- bfs? )
-    traversal-method get {
-        { +breadth-first+ [ t ] }
-        { +depth-first+ [ f ] }
-    } case ; inline
-
-: setup-traversal ( path quot -- iter quot' )
-    [ bfs? <directory-iterator> ] dip [ f ] compose ; inline
-
-PRIVATE>
-
-: each-file ( ... path quot: ( ... name -- ... ) -- ... )
-    setup-traversal iterate-directory drop ; inline
-
-: each-directory-entry ( path quot: ( ... entry -- ... ) -- )
-    setup-traversal iterate-directory-entries drop ; inline
-
-: recursive-directory-files ( path -- paths )
-    [ ] collector [ each-file ] dip ;
-
-: recursive-directory-entries ( path -- directory-entries )
-    [ ] collector [ each-directory-entry ] dip ;
-
-: find-file ( path quot: ( ... name -- ... ? ) -- path/f )
-    [ bfs? <directory-iterator> ] dip
-    '[ _ keep and ] iterate-directory ; inline
-
-: find-files ( path quot: ( ... name -- ... ? ) -- paths )
-    selector [ each-file ] dip ; inline
-
-ERROR: sequence-expected obj ;
-
-: ensure-sequence-of-directories ( obj -- seq )
-    dup string? [ 1array ] when
-    dup sequence? [ sequence-expected ] unless ;
-
-: find-file-in-directories ( directories quot: ( ... name -- ... ? ) -- path'/f )
-    [ ensure-sequence-of-directories ] dip
-    '[ _ find-file ] map-find drop ; inline
-
-: find-files-in-directories ( directories quot: ( ... name -- ... ? ) -- paths/f )
-    [ ensure-sequence-of-directories ] dip
-    '[ _ find-files ] map concat ; inline
-
-: ?parent-directory ( path -- path'/f )
-    dup parent-directory 2dup = [ 2drop f ] [ nip ] if ;
-
-: containing-directory ( path -- path' )
-    dup file-info directory? [ parent-directory ] unless ;
-
-: ?qualified-directory-files ( path -- seq )
-    [ qualified-directory-files ]
-    [ drop ?parent-directory [ ?qualified-directory-files ] [ f ] if* ] recover ;
-
-: (find-up-to-root) ( path quot: ( path -- ? ) -- obj )
-    [ [ ?qualified-directory-files ] dip find swap ] 2keep rot [
-        2drop
-    ] [
-        [ nip ?parent-directory ] dip over
-        [ (find-up-to-root) ] [ 2drop f ] if
-    ] if ; inline recursive
-
-: find-up-to-root ( path quot: ( path -- ? ) -- obj )
-    [ normalize-path containing-directory ] dip (find-up-to-root) ; inline
-
-: link-size/0 ( path -- n )
-    [ link-info size-on-disk>> ] [ 2drop 0 ] recover ;
-
-: directory-size ( path -- n )
-    0 swap [ link-size/0 + ] each-file ;
-
-: directory-usage ( path -- assoc )
-    [
-        [
-            [ name>> dup ] [ directory? ] bi
-            [ directory-size ] [ link-size/0 ] if
-        ] { } map>assoc
-    ] with-qualified-directory-entries sort-values ;
-
-: find-files-by-extensions ( path extensions -- seq )
-    [ >lower ] map
-    '[ >lower _ [ tail? ] with any? ] find-files ;
-
-: find-files-by-extension ( path extension -- seq )
-    1array find-files-by-extensions ;
-
-: find-files-larger-than ( path size -- seq )
-    '[ link-info size>> _ > ] find-files ;
diff --git a/basis/io/directories/search/summary.txt b/basis/io/directories/search/summary.txt
deleted file mode 100644 (file)
index a9df0ba..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Recursive directory traversal
index 2924ec33634385c5f05fcb106431e3c13056e62b..1a67edef8cf66a40dbdb96c289383c047e7bca67 100644 (file)
@@ -1,7 +1,6 @@
-USING: accessors continuations io.directories
-io.directories.hierarchy io.encodings.ascii io.files
-io.files.info io.files.temp io.files.unique io.pathnames kernel
-namespaces sequences strings tools.test ;
+USING: accessors continuations io.directories io.encodings.ascii
+io.files io.files.info io.files.temp io.files.unique
+io.pathnames kernel namespaces sequences strings tools.test ;
 
 { 123 } [
     [
index 9a2647a52e492aa039d605fb84b0f93f4fd8fe05..e0452567ef7714046aaa94ebf3856d52ff63a801 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators continuations fry io.backend io.directories
-io.directories.hierarchy io.pathnames kernel locals namespaces
-random.data sequences system vocabs ;
+io.pathnames kernel locals namespaces random.data sequences
+system vocabs ;
 IN: io.files.unique
 
 <PRIVATE
index 5f0d33487158795bde5e39e17451186141ac2621..0217314f55c4fadf0a70b0dff055d53c2f954826 100644 (file)
@@ -1,7 +1,7 @@
 USING: accessors math kernel namespaces continuations
 io.files io.monitors io.monitors.recursive io.backend
 concurrency.mailboxes tools.test destructors io.files.info
-io.pathnames io.files.temp io.directories.hierarchy fry ;
+io.pathnames io.files.temp io.directories fry ;
 IN: io.monitors.recursive.tests
 
 SINGLETON: mock-io-backend
index 0a2558bdeb7b8a34ade7b5f198958bee2bbcebf0..eaab8c64ee94debbb02b681498f08d3937a5afc4 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2011 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays combinators.smart environment fry
-io.directories.search io.files io.pathnames io.standard-paths
+io.directories io.files io.pathnames io.standard-paths
 kernel sequences sets splitting system unicode windows.shell32 ;
 IN: io.standard-paths.windows
 
index 53dd61548037508ec2efaf186a08cb6eb49a5149..eafaee665fda27513640a4356f8d6fc011dfe3b9 100644 (file)
@@ -1,5 +1,5 @@
-USING: continuations io io.directories.hierarchy io.files.temp
-logging logging.analysis logging.server math tools.test ;
+USING: continuations io io.files.temp logging logging.analysis
+logging.server math tools.test ;
 IN: logging.tests
 
 : input-logging-test ( a b -- c ) + ;
index ea9b3e7f32e61a3fa21efef92c265901424b0ee7..2b6a8e3a09543dbfdfcfcab2f1a6cb3d3ab344ef 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: io io.files io.files.info.unix io.pathnames
-io.directories io.directories.hierarchy kernel namespaces make
+io.directories kernel namespaces make
 sequences system tools.deploy.backend tools.deploy.config
 tools.deploy.config.editor assocs hashtables prettyprint
 io.backend.unix cocoa io.encodings.utf8 io.backend
index 28de80524a0d8730aeeadd491ff1592bac3d2003..d73c533de778ec5162fb0bfedfd0fb6309d1af3c 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2010 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: globs io.directories io.directories.hierarchy
-io.files.info io.pathnames kernel regexp sequences sets
-vocabs.loader vocabs.metadata ;
+USING: globs io.directories io.files.info io.pathnames kernel
+regexp sequences sets vocabs.loader vocabs.metadata ;
 IN: vocabs.metadata.resources
 
 <PRIVATE
index 673587aa3cc6f9693bc4092f19e196b972de2f03..facd1d2369a72ae8a3c658f5f70d342100a38a07 100644 (file)
@@ -2,12 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs calendar calendar.format
 combinators combinators.short-circuit fry io io.backend
-io.directories io.directories.hierarchy io.encodings.binary
-io.encodings.detect io.encodings.utf8 io.files io.files.info
-io.files.temp io.files.types io.files.unique io.launcher
-io.pathnames kernel locals math math.parser namespaces sequences
-sorting strings system unicode xml.syntax xml.writer
-xmode.catalog xmode.marker xmode.tokens ;
+io.directories io.encodings.binary io.encodings.detect
+io.encodings.utf8 io.files io.files.info io.files.temp
+io.files.types io.files.unique io.launcher io.pathnames kernel
+locals math math.parser namespaces sequences sorting strings
+system unicode xml.syntax xml.writer xmode.catalog xmode.marker
+xmode.tokens ;
 IN: codebook
 
 ! Usage: "my/source/tree" codebook
index ed1415e6acb446fc287165e2d351b31f74bc4d61..3e1f389760d07a005029e54e0e3cb23065388817 100644 (file)
@@ -3,11 +3,10 @@
 USING: accessors arrays assocs assocs.extras calendar
 calendar.format checksums checksums.sha combinators
 combinators.smart compression.zlib constructors fry grouping io
-io.binary io.directories io.directories.search
-io.encodings.binary io.encodings.string io.encodings.utf8
-io.files io.files.info io.pathnames io.streams.byte-array
-io.streams.peek kernel math math.bitwise math.parser
-math.statistics memoize namespaces random sequences
+io.binary io.directories io.encodings.binary io.encodings.string
+io.encodings.utf8 io.files io.files.info io.pathnames
+io.streams.byte-array io.streams.peek kernel math math.bitwise
+math.parser math.statistics memoize namespaces random sequences
 sequences.extras splitting strings ;
 IN: git
 
index d64ea8a8826ad41c8ce26dd6ebf51f08fb37f959..0c6880bf3b80c2834c89b68981fbed3d04a6634f 100644 (file)
@@ -5,7 +5,7 @@ strings kernel math io.mmap accessors combinators math.ranges
 unicode byte-arrays io.encodings.string
 io.encodings.utf16 assocs math.parser combinators.short-circuit
 fry namespaces combinators.smart splitting io.encodings.ascii
-arrays io.files.info io.directories.search literals
+arrays io.files.info io.directories literals
 math.functions continuations ;
 FROM: alien.c-types => uchar ;
 IN: id3
index 765a1a23a210fa97d867583ce456089ec82c3261..2b42de1bbe069c5d7ed0b7f83d88133b238482e8 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays io.directories io.directories.hierarchy io.files
-kernel mason.common mason.config mason.platform namespaces ;
+USING: arrays io.directories io.files kernel mason.common
+mason.config mason.platform namespaces ;
 IN: mason.cleanup
 
 : compress ( filename -- )
index 681646b749350608c7f2a8b9b73bbebbea161628..1a9954f8b45d148d3d505e676667eee697237bde 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors continuations debugger io io.directories
-io.directories.hierarchy io.encodings.utf8 io.files io.launcher
-io.sockets io.streams.string kernel mason.common mason.email sequences
+io.encodings.utf8 io.files io.launcher io.sockets
+io.streams.string kernel mason.common mason.email sequences
 splitting ;
 IN: mason.git
 
index 79fb4c34f4a87ca53a95baeb52b108a7a2418bf1..74d5b37603651975a99f78ecac696bbb67922dd9 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors combinators io.directories
-io.directories.hierarchy io.files io.pathnames kernel literals
-locals make mason.common mason.config mason.platform namespaces
-sequences system words ;
+io.files io.pathnames kernel literals locals make mason.common
+mason.config mason.platform namespaces sequences system words ;
 IN: mason.release.archive
 
 : base-name ( -- string )
index 79630b1e0c215546a6facf45a9eda5c32a6265dd..ed791b36d7e42214e4c02e56562675d19a0fce47 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008, 2011 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: bootstrap.image io.directories io.directories.hierarchy
-io.files kernel namespaces sequences system ;
+USING: bootstrap.image io.directories io.files kernel namespaces
+sequences system ;
 FROM: mason.config => target-os ;
 IN: mason.release.tidy
 
index 81a1ba8226c45686713d2dd372a918038b88707e..6f5efe3c1b795e7fb30129a42392cb9f00162428 100644 (file)
@@ -1,6 +1,5 @@
-USING: io.directories io.directories.hierarchy io.files
-io.files.temp kernel mason.common mason.config mason.report
-namespaces tools.test xml xml.writer ;
+USING: io.directories io.files io.files.temp kernel mason.common
+mason.config mason.report namespaces tools.test xml xml.writer ;
 IN: mason.report.tests
 
 { 0 0 } [ [ ] with-report ] must-infer-as
index e8bc9c061efd0b906d0b5fac35399cd4c8ab6a85..012aaeafdbcb47934080a2b0b0b1f4bb7ecf1c17 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2018 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: base91 combinators command-line escape-strings fry
-io.backend io.directories io.directories.search
-io.encodings.binary io.encodings.utf8 io.files io.files.info
-io.pathnames kernel locals math namespaces sequences
-sequences.extras splitting ;
+io.backend io.directories io.encodings.binary io.encodings.utf8
+io.files io.files.info io.pathnames kernel locals math
+namespaces sequences sequences.extras splitting ;
 IN: tools.directory-to-file
 
 : file-is-text? ( path -- ? )
index dd4798c803e5230c73554ef12f345fb5d0086300..438e916d3e4bb9e3dcb7f8df82d123e028afc88c 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors furnace.actions help.html
-http.server.responses io.directories io.directories.hierarchy
-io.files io.launcher io.pathnames kernel mason.config memoize
-namespaces sequences threads webapps.mason.utils ;
+USING: accessors furnace.actions help.html http.server.responses
+io.directories io.files io.launcher io.pathnames kernel
+mason.config memoize namespaces sequences threads
+webapps.mason.utils ;
 IN: webapps.mason.docs-update
 
 : docs-path ( -- path )
index c98121ed287d6d2cde9e442d3afa666ce35532bd..a1397511a585542ec26264ee873a6cb6a9b35c6a 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: bootstrap.image bootstrap.image.download io
-io.directories io.directories.hierarchy io.files.temp
-io.files.unique io.launcher io.pathnames kernel namespaces
-sequences mason.common mason.config webapps.mason.version.files ;
+io.directories io.files.temp io.files.unique io.launcher
+io.pathnames kernel namespaces sequences mason.common
+mason.config webapps.mason.version.files ;
 IN: webapps.mason.version.source
 
 : clone-factor ( -- )