diff --git a/core/io/files/files-docs.factor b/core/io/files/files-docs.factor index 1ff972b505..6eb025b6fd 100755 --- a/core/io/files/files-docs.factor +++ b/core/io/files/files-docs.factor @@ -1,5 +1,5 @@ -USING: help.markup help.syntax io io.styles strings -io.backend io.files.private quotations ; +USING: help.markup help.syntax io io.styles strings calendar + io.backend io.files.private quotations ; IN: io.files ARTICLE: "file-streams" "Reading and writing files" @@ -43,12 +43,18 @@ ARTICLE: "directories" "Directories" { $subsection make-directory } { $subsection make-directories } ; +! ARTICLE: "file-types" "File Types" + +! { $table { +directory+ "" } } + +! ; + ARTICLE: "fs-meta" "File meta-data" + { $subsection file-info } { $subsection link-info } { $subsection exists? } { $subsection directory? } -{ $subsection file-length } { $subsection file-modified } { $subsection stat } ; @@ -119,11 +125,26 @@ HELP: file-name ! need a $class-description file-info HELP: file-info + { $values { "path" "a pathname string" } - { "info" "a file-info tuple" } } + { "info" file-info } } { $description "Queries the file system for meta data. " "If path refers to a symbolic link, it is followed." - "If the file does not exist, an exception is thrown." } ; + "If the file does not exist, an exception is thrown." } + + { $class-description "File meta data" } + + { $table + { "type" { "One of the following:" + { $list { $link +regular-file+ } + { $link +directory+ } + { $link +symbolic-link+ } } } } + + { "size" "Size of the file in bytes" } + { "modified" { "Last modification " { $link timestamp } } } } + + ; + ! need a see also to link-info HELP: link-info @@ -135,6 +156,8 @@ HELP: link-info "If the file does not exist, an exception is thrown." } ; ! need a see also to file-info +{ file-info link-info } related-words + HELP: { $values { "path" "a pathname string" } { "encoding" "an encoding descriptor" { "stream" "an input stream" } } { "stream" "an input stream" } } @@ -199,7 +222,7 @@ HELP: stat ( path -- directory? permissions length modified ) "Queries the file system for file meta data. If the file does not exist, outputs " { $link f } " for all four values." } ; -{ stat exists? directory? file-length file-modified } related-words +{ stat exists? directory? file-modified } related-words HELP: path+ { $values { "str1" "a string" } { "str2" "a string" } { "str" "a string" } } @@ -227,9 +250,9 @@ HELP: directory* { $description "Outputs the contents of a directory named by " { $snippet "path" } "." } { $notes "Unlike " { $link directory } ", this word prepends the directory's path to all file names in the list." } ; -HELP: file-length -{ $values { "path" "a pathname string" } { "n" "a non-negative integer or " { $link f } } } -{ $description "Outputs the length of the file in bytes, or " { $link f } " if it does not exist." } ; +! HELP: file-length +! { $values { "path" "a pathname string" } { "n" "a non-negative integer or " { $link f } } } +! { $description "Outputs the length of the file in bytes, or " { $link f } " if it does not exist." } ; HELP: file-modified { $values { "path" "a pathname string" } { "n" "a non-negative integer or " { $link f } } }