1 USING: arrays help.markup help.syntax kernel io.files ;
5 { $values { "path" "a pathname string" } { "info" file-info-tuple } }
6 { $description "Queries the file system for metadata. If " { $snippet "path" } " refers to a symbolic link, it is followed. See the article " { $link "file-types" } " for a list of metadata symbols." }
7 { $errors "Throws an error if the file does not exist." } ;
10 { $values { "path" "a pathname string" } { "info" file-info-tuple } }
11 { $description "Queries the file system for metadata. If " { $snippet "path" } " refers to a symbolic link, information about the symbolic link itself is returned. See the article " { $link "file-types" } " for a list of metadata symbols." }
12 { $errors "Throws an error if the file does not exist." } ;
14 { file-info link-info file-info-tuple } related-words
17 { $values { "path/info" { $or "a pathname string" file-info-tuple } } { "?" boolean } }
18 { $description "Tests if " { $snippet "path/info" } " is a directory." } ;
21 { $values { "path/info" { $or "a pathname string" file-info-tuple } } { "?" boolean } }
22 { $description "Tests if " { $snippet "path/info" } " is a normal file." } ;
25 { $values { "path/info" { $or "a pathname string" file-info-tuple } } { "?" boolean } }
26 { $description "Tests if " { $snippet "path/info" } " is a symbolic link." } ;
29 { $values { "array" array } }
30 { $description "Returns an array of " { $link file-system-info } " objects returned by iterating the mount points and calling " { $link file-system-info } " on each." }
31 { $notes "File systems that the process doesn't have access to aren't included." } ;
33 HELP: file-system-info
35 { "path" "a pathname string" }
36 { "file-system-info" file-system-info-tuple } }
37 { $description "Returns a platform-specific object describing the file-system that contains the path. The cross-platform slot is " { $slot "free-space" } "." }
40 "USING: io.files.info io.pathnames math prettyprint ;"
43 ": gb ( m -- n ) 30 2^ * ;"
45 "home file-system-info free-space>> 100 gb < ."
51 { $values { "path" "a pathname string" } { "?" boolean } }
52 { $description "Returns whether the file specified by " { $snippet "path" } " is readable by the current process." }
53 { $errors "Throws an error if the file does not exist." } ;
56 { $values { "path" "a pathname string" } { "?" boolean } }
57 { $description "Returns whether the file specified by " { $snippet "path" } " is writable by the current process." }
58 { $errors "Throws an error if the file does not exist." } ;
60 HELP: file-executable?
61 { $values { "path" "a pathname string" } { "?" boolean } }
62 { $description "Returns whether the file specified by " { $snippet "path" } " is executable by the current process." }
63 { $errors "Throws an error if the file does not exist." } ;
65 ARTICLE: "io.files.info" "File system metadata"
76 { $subsections "file-types" }
77 "File system metadata:"
89 ABOUT: "io.files.info"