2006-08-16 21:55:53 -04:00
USING: help io styles ;
2006-01-16 02:48:15 -05:00
2006-08-16 21:55:53 -04:00
HELP: cwd ( -- path )
2006-06-19 20:14:33 -04:00
{ $values { "path" "a path name string" } }
2006-06-05 22:04:49 -04:00
{ $description "Outputs the current working directory of the Factor process." }
{ $see-also cd } ;
2006-08-16 21:55:53 -04:00
HELP: cd ( path -- )
2006-06-19 20:14:33 -04:00
{ $values { "path" "a path name string" } }
2006-06-05 22:04:49 -04:00
{ $description "Changes the current working directory of the Factor process." }
{ $see-also cwd } ;
2006-08-16 21:55:53 -04:00
HELP: stat ( path -- array/f )
2006-06-19 20:14:33 -04:00
{ $values { "path" "a path name string" } { "array/f" "a four-element array or " { $link f } } }
2006-01-19 03:03:32 -05:00
{ $description
2006-06-05 22:04:49 -04:00
"If the file does not exist, outputs " { $link f } ". Otherwise, outputs a four-element array:"
2006-01-19 03:03:32 -05:00
{ $list
"boolean indicating if the file is a directory"
"the length in bytes as an integer"
2006-06-05 22:04:49 -04:00
"a Unix permission bitmap (0 on Windows)"
2006-01-19 03:03:32 -05:00
"the last modification time, as milliseconds since midnight, January 1st 1970 GMT"
}
} ;
2006-08-16 21:55:53 -04:00
HELP: path+
2006-01-16 02:48:15 -05:00
{ $values { "str1" "a string" } { "str2" "a string" } { "str" "a string" } }
{ $description "Concatenates two path names." } ;
2006-08-16 21:55:53 -04:00
HELP: exists?
2006-01-16 02:48:15 -05:00
{ $values { "path" "a string" } { "?" "a boolean" } }
{ $description "Tests if the file named by " { $snippet "path" } " exists." } ;
2006-08-17 23:08:04 -04:00
HELP: directory?
2006-01-16 02:48:15 -05:00
{ $values { "path" "a string" } { "?" "a boolean" } }
{ $description "Tests if " { $snippet "path" } " names a directory." } ;
2006-08-16 21:55:53 -04:00
HELP: directory
2006-01-16 02:48:15 -05:00
{ $values { "path" "a string" } { "seq" "a sequence of file name strings" } }
{ $description "Outputs a sorted sequence of file names stored in the directory named by " { $snippet "path" } "." } ;
2006-08-16 21:55:53 -04:00
HELP: file-length
2006-01-16 02:48:15 -05:00
{ $values { "path" "a 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." } ;
2006-08-16 21:55:53 -04:00
HELP: parent-dir
{ $values { "path" "a string" } { "parent" "a string" } }
{ $description "Strips the last component off a path name." }
{ $examples { $example "\"/etc/passwd\" parent-dir print" "/etc" } } ;
HELP: resource-path
2006-01-16 02:48:15 -05:00
{ $values { "resource" "a string" } { "path" "a string" } }
2006-08-16 21:55:53 -04:00
{ $description "Resolve a path relative to the Factor source code location. This first checks if the " { $link resource-path } " variable is set to a path, and if not, uses the parent directory of the current image." } ;
2006-01-16 02:48:15 -05:00
2006-08-16 21:55:53 -04:00
HELP: pathname
2006-08-17 23:08:04 -04:00
{ $class-description "Class of path name presentations. Instances can be used passed to " { $link write-object } " to output a clickable path name." } ;
2006-08-16 21:55:53 -04:00
HELP: directory.
2006-01-16 02:48:15 -05:00
{ $values { "path" "a string" } }
{ $description "Prints a directory listing to the " { $link stdio } " stream. If the stream supports it, subdirectories are shown as expandable outliners." } ;