listfiles

Overview of the listfiles function.

Function definition
function listfiles(path: string): { string }

Errors:

  • Illegal Path

    • The path provided is considered 'unsafe'.

Remarks

Whilst it may seem that listfilesimplies that only files will be enumerated, in reality, both files and folders will be enumerated.

High-Level Overview:

The listfiles function follows the already defined UNC specification; it will return all the folders found at the provided path.

Low-Level Overview:

pathis read from the luau heap, then utilising std::filesystem::is_directorywe validate if the provided path (once sanitised) is pointing to a valid folder in the filesystem; if it is, then we use an std::filesystem::directory_iterator. and push the paths of the files found to the array that is returned.

Last updated