cleanup, docs
This commit is contained in:
+14
-10
@@ -2,16 +2,20 @@
|
||||
StringList ls(String path)
|
||||
|
||||
:params
|
||||
path : a filesystem path
|
||||
return value : list of directory entries
|
||||
path : directory to list
|
||||
return value : a StringList of entry names
|
||||
|
||||
:content
|
||||
Returns the names of the entries in a directory as a `StringList`. For names only this is simpler than `dir_list()`, which returns full metadata per entry.
|
||||
|
||||
:example
|
||||
mkdir("/tmp/doc-ls");
|
||||
file_put_contents("/tmp/doc-ls/one.txt", "1");
|
||||
file_put_contents("/tmp/doc-ls/two.txt", "2");
|
||||
print(join(ls("/tmp/doc-ls").sort(), ","), "\n");
|
||||
dir_remove("/tmp/doc-ls", true);
|
||||
|
||||
:see
|
||||
>sys
|
||||
|
||||
:content
|
||||
Returns a list of files and subdirectories within `path`.
|
||||
|
||||
This is a simple directory listing helper for filesystem-oriented tasks.
|
||||
|
||||
:example
|
||||
print("ls example\n");
|
||||
dir_list
|
||||
0_StringList
|
||||
|
||||
Reference in New Issue
Block a user