readdirRead entry from directory handle
&reftitle.description;
stringreaddirresourcedir_handle
Returns the filename of the next file from the directory. The
filenames are returned in the order in which they are stored by
the filesystem.
Please note the fashion in which readdir's
return value is checked in the examples below. We are explicitly
testing whether the return value is identical to (equal to and of
the same type as--see Comparison
Operators for more information) &false; since otherwise,
any directory entry whose name evaluates to &false; will stop the
loop (e.g. a directory named "0").
List all files in a directory
]]>
Note that readdir will return the .
and
.. entries. If you don't want these, simply strip
them out:
List all files in the current directory and strip out .
and ..
]]>
See also is_dir and
glob.