dir_list
host callCapy
function dir_list(path : string) dval
Description
dir_list() returns one map for each directory entry.
Each map has name, type, size, and mtime. The type value is file, dir, symlink, or other.
Parameters
path : the directory path to list
Return Values
A dval list of entry maps.
Example
Capy
var root := file_temp("/tmp/capy-doc-dir-list-")
file_unlink(root)
mkdir(root)
file_put_contents(path_join(root, "note.txt"), "hi")
for item, key := dir_list(root) { print(string(item.name), "\n") }
dir_remove(root, true)