io.directories.*: move of the qualified directory listing words to io.directories

char-rename
Björn Lindqvist 2016-07-30 15:02:37 +02:00
parent 9ba5419bef
commit ba4bb45d4d
3 changed files with 27 additions and 15 deletions

View File

@ -45,9 +45,17 @@ HELP: directory-entries
{ $values { "path" "a pathname string" } { "seq" "a sequence of " { $link directory-entry } " objects" } }
{ $description "Outputs the contents of a directory named by " { $snippet "path" } "." } ;
HELP: qualified-directory-entries
{ $values { "path" "a pathname string" } { "seq" "a sequence of " { $link directory-entry } " objects" } }
{ $description "Outputs the contents of a directory named by " { $snippet "path" } ". using absolute file paths." } ;
HELP: directory-files
{ $values { "path" "a pathname string" } { "seq" "a sequence of filenames" } }
{ $description "Outputs the contents of a directory named by " { $snippet "path" } "." } ;
{ $description "Outputs the contents of a directory named by " { $snippet "path" } " as a sequence of filenames." } ;
HELP: qualified-directory-files
{ $values { "path" "a pathname string" } { "seq" "a sequence of filenames" } }
{ $description "Outputs the contents of a directory named by " { $snippet "path" } " as a sequence of absolute paths." } ;
HELP: with-directory-files
{ $values { "path" "a pathname string" } { "quot" quotation } }
@ -148,6 +156,10 @@ ARTICLE: "io.directories.listing" "Directory listing"
directory-files
with-directory-entries
with-directory-files
qualified-directory-entries
qualified-directory-files
with-qualified-directory-files
with-qualified-directory-entries
} ;
ARTICLE: "io.directories.create" "Creating directories"

View File

@ -54,6 +54,20 @@ HOOK: (directory-entries) os ( path -- seq )
: with-directory-files ( path quot -- )
'[ "" directory-files @ ] with-directory ; inline
: qualified-directory-entries ( path -- seq )
absolute-path
dup directory-entries [ [ append-path ] change-name ] with map! ;
: qualified-directory-files ( path -- seq )
absolute-path
dup directory-files [ append-path ] with map! ;
: with-qualified-directory-files ( path quot -- )
'[ "" qualified-directory-files @ ] with-directory ; inline
: with-qualified-directory-entries ( path quot -- )
'[ "" qualified-directory-entries @ ] with-directory ; inline
! Touching files
HOOK: touch-file io-backend ( path -- )

View File

@ -6,20 +6,6 @@ kernel.private locals math sequences sequences.extras sorting
strings system unicode vocabs ;
IN: io.directories.search
: qualified-directory-entries ( path -- seq )
absolute-path
dup directory-entries [ [ append-path ] change-name ] with map! ;
: qualified-directory-files ( path -- seq )
absolute-path
dup directory-files [ append-path ] with map! ;
: with-qualified-directory-files ( path quot -- )
'[ "" qualified-directory-files @ ] with-directory ; inline
: with-qualified-directory-entries ( path quot -- )
'[ "" qualified-directory-entries @ ] with-directory ; inline
<PRIVATE
TUPLE: directory-iterator