lovr.filesystem.read

Edit

Read the contents of a file.

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

Arguments

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

Returns

NameTypeDescription
contentsstring The contents of the file.
bytesnumber The number of bytes read from the file.

Notes

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

See also