lovr.filesystem.mount
EditMounts 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
Name | Type | Default | Description |
path | string | The path to mount. | |
mountpoint | string | '/' | The path in the virtual filesystem to mount to. |
append | boolean | false | Whether the archive will be added to the end or the beginning of the search path. |
root | string | nil |
A subdirectory inside the archive to use as the root. If nil , the actual root of the archive is used.
|
Returns
Name | Type | Description |
success | boolean | 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