lovr.filesystem.read

Read the contents of a file.

contents, bytes = lovr.filesystem.read(filename, bytes)

Arguments

NameTypeDefaultDescription
filenamestringThe name of the file to read.
bytesnumber-1The number of bytes to read (if -1, all bytes will be read).

Returns

NameTypeDescription
contentsstringThe contents of the file.
bytesnumberThe number of bytes read from the file.

Notes

If the file does not exist or cannot be read, nil is returned.

See also