sysutils.dirsize(path)function
Returns the total size of a directory in bytes, including all subdirectories and files.
Parameters
path
The directory path as astring, or a Directory.
Return value
Returns the total size of the directory in bytes as anumber, or nil if the directory doesn't exist.
Example
--! luart-extensions
import sysutils
local size = sysutils.dirsize("C:\\Windows")
if size then
print("C:\\Windows directory size: "..math.floor(size/1024/1024).." MB")
else
print("Directory not found")
end