Capy-Bearer Documentation

ls

host call

Capy

function ls(path : string) dval

Description

ls() returns the names in a directory. It returns an empty list when it cannot list the directory.

Parameters

path : directory path to list

Return Values

A dval list of entry names.

Example

Capy

var root := file_temp("/tmp/capy-doc-ls-")
file_unlink(root)
mkdir(root)
file_put_contents(path_join(root, "one.txt"), "1")
print(join(sort(ls(root)), ","), "\n")
dir_remove(root, true)