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
pathstring The path to mount.
mountpointstring'/' The path in the virtual filesystem to mount to.
appendbooleanfalse Whether the archive will be added to the end or the beginning of the search path.
rootstringnil A subdirectory inside the archive to use as the root. If nil, the actual root of the archive is used.

Returns

NameTypeDescription
successboolean Whether 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.

This function is not thread safe. Mounting or unmounting an archive while other threads call lovr.filesystem functions is not supported.

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