Files

File Exists

Definition

fileExists(path: string) -> boolean

Usage example

print(fileExists('my_file.lua'))
-- true

Source code

function fileExists(path)
    local f = io.open(path, 'r')
    return f ~= nil and io.close(f)
end

Get Files Recursively

Definition

getFilesRecursive(path: string, maxDepth: integer) -> table
--
-- getFilesRecursive()
--
-- @param  string    path      The starting path: Default: '.' (mod's root folder)
-- @param  integer   maxDepth  The maximum depth allowed. Default: -1 (unlimited)
--
getFilesRecursive('.', -1)

Usage example

Source code

Get Folders Recursively

Definition

Usage example

Source code

Last updated