lovr.filesystem.getSize

Edit

Returns the size of a file, in bytes.

size, error = lovr.filesystem.getSize(file)

Arguments

NameTypeDescription
filestring The file.

Returns

NameTypeDescription
sizenumber | nil The size of the file, in bytes, or nil if there was an error.
errorstring | nil The error message, if the operation was not successful.

Notes

If the file does not exist, an error is thrown.

See also