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)


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.


successboolean Whether the archive was successfully mounted.


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.


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