listdir
displays the contents of a directory
Calling Sequence
Parameters
Description
Examples
listdir(filename)
filename
-
name of the directory to be displayed
The contents of the directory filename are returned as a list. The directories . (current) and .. (directory that is one level higher) are included.
If filename does not exist, listdir generates an error.
If filename is not a directory, listdir generates an error.
See file for information on file names.
listdir⁡/home/maple/m
.,..,foo1.m,foo2.m,xbar.m
listdir⁡/home/maple/m/foo1.m
Error, (in listdir) directory does not exist
listdir⁡/home/maple/noexist
Error, (in isdir) file or directory does not exist
See Also
file
FileTools[ListDirectory]
fopen
IO_errors
isdir
open
Download Help Document