ReadDirEntry Function

Reads the current directory entry as a local filename, then moves to the next file.

bool ReadDirEntry(Handle dir, char[] buffer, int maxlength, FileType& type)


Handle dir

Handle to a directory.

char[] buffer

String buffer to hold directory name.

int maxlength

Maximum size of string buffer.

FileType& type

Optional variable to store the file type.

Return Value

True on success, false if there are no more files to read.


Invalid or corrupt Handle.


Contents of buffers are undefined when returning false.

Both the '.' and '..' automatic directory entries will be retrieved for Windows and Linux.