The "file_list" Function
#
SyntaxArgument | Type | Description |
---|---|---|
dname | string | The full path of the target directory, including drive letter |
attr | integer/constant | Enables filtering results as directories (fa_directory ) or files (anything else) |
[recurse] | boolean | Optional: Enables including subdirectories in scan results (disabled by default) |
#
DescriptionScans a directory and returns the contents as a ds_list
, including relative paths (if any), filenames, and extensions.
The attribute filter and recursive options can only be used on Windows. All other platforms should set attr
to 0
and ignore the optional recurse
argument.
If the attribute filter is supported and set to fa_directory
, only directories will be returned. This is the only supported filter, and all other options will return a list of files instead.
caution
To achieve best processing speed, files without extensions are not supported by this script.
important
By default, this script can only be used to scan directories within working_directory
or elsewhere previously granted access via the get_save_filename
function. On desktop platforms, this limitation can be removed by disabling the filesystem sandbox in Game Settings.