lovr.filesystem.mount

Mounts a directory or .zip archive, adding it to the virtual filesystem. This allows you to read files from it.

success = lovr.filesystem.mount(path, mountpoint, append, root)

Arguments

NameTypeDefaultDescription
pathstringThe path to mount.
mountpointstring'/'The path in the virtual filesystem to mount to.
appendbooleanfalseWhether the archive will be added to the end or the beginning of the search path.
rootstringnilA subdirectory inside the archive to use as the root. If nil, the actual root of the archive is used.

Returns

NameTypeDescription
successbooleanWhether the archive was successfully mounted.

Notes

The append option lets you control the priority of the archive's files in the event of naming collisions.

Example

Mount data.zip with a file images/background.png:

lovr.filesystem.mount('data.zip', 'assets')
print(lovr.filesystem.isFile('assets/images/background.png')) -- true

See also