n, ... = CountDirectoryEntries(id[, what, recursive])
id
. This directory
must have been opened using OpenDirectory() or @DIRECTORY
before.
The optional argument what
can be used to specify what kind of entries should be counted. The
following entry types are currently supported:
#COUNTFILES:
#COUNTDIRECTORIES:
#COUNTBOTH:
#COUNTSEPARATE:
Starting with Hollywood 9.0, there is a new optional argument named recursive
. If this
is set to True
, CountDirectoryEntries()
will recurse into all subdirectories and include
those in the count as well.
Note that CountDirectoryEntries()
will iterate through all entries in the directory
so it must not be used during an iteration using NextDirectoryEntry().
Doing so will automatically rewind any existing directory iterations.
#COUNTFILES
)False
) (V9.0)OpenDirectory(1, "data") NPrint(CountDirectoryEntries(1))The code above prints the number of files in the directory
data
.