Function: DirectoryGetEntries

Synopsis

Calls a callback function for every sub-directory in the given path.

Syntax

DirectoryGetEntries( <path>, <callback>, [<end_to_start>] )
  • path: The directory to iterate.
  • callback: The callback that will be called for each item in the directory. This function must return true for the loop to continue.
  • end_to_start: Makes the function iterate the directory in reverse order. Optional, defaults to false.

Examples

-- Print each file and whether or not it's a directory.
DirectoryGetEntries(Path, function(File, IsDirectory)
	print(File, IsDirectory)
end)

Notes

No additional notes.

History

1.18

Added a third argument that specifies whether or not to return the list of files and folders in reverse order.

Before 1.18

Changes prior to this version were not adequately tracked.

Back to top