Name
NextDirectoryEntry -- get next entry from an open directory (V4.0)
Synopsis
t = NextDirectoryEntry(id)
Function
This function gets the next entry from a directory previously opened using OpenDirectory() or @DIRECTORY. The function will return a table that contains detailed information about the entry just retrieved. If there are no more entries in the specified directory, this function will return Nil. Normally, this function is called in a loop until it returns Nil. That way you can scan the whole contents of a directory.

The table that is returned by this function will have the following fields initialized:

Name:
This field will contain the name of entry.

Type:
This will be #DOSTYPE_FILE if the entry is a file or #DOSTYPE_DIRECTORY if the entry is a directory.

Size:
This field will only be present if the entry is a file. In that case, this field will receive the size of the file in bytes.

Flags:
This field will receive a combination of protection flags of the file or directory. See Protection flags for details.

Time:
This field will receive a string containing the time the file or directory was last modified. The string will always be in the format dd-mmm-yyyy hh:mm:ss. E.g.: 08-Nov-2004 14:32:13.

LastAccessTime:
This field will receive a string containing the time the file or directory was last accessed. This attribute is not supported on AmigaOS.

CreationTime:
This field will receive a string containing the time the file or directory was created. This attribute is only supported on Win32.

Comment:
This field will contain the comment of a file. This is only supported by the Amiga versions.

To rewind a directory iteration, use the RewindDirectory() function. See RewindDirectory for details.

Inputs
id
identifier of the directory to query
Results
t
a table initialized as shown above
Example
See OpenDirectory


Show TOC