listdir - Maple Programming Help

Home : Support : Online Help : System : External Functions : listdir

listdir

displays the contents of a directory

 Calling Sequence listdir(filename)

Parameters

 filename - name of the directory to be displayed

Description

 • 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.

Examples

 > $\mathrm{listdir}\left("/home/maple/m"\right)$
 $\left[{"."}{,}{".."}{,}{"foo1.m"}{,}{"foo2.m"}{,}{"xbar.m"}\right]$ (1)
 > $\mathrm{listdir}\left("/home/maple/m/foo1.m"\right)$

 Error, (in listdir) directory does not exist

 > $\mathrm{listdir}\left("/home/maple/noexist"\right)$

 Error, (in isdir) file or directory does not exist