Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writable Archives #757

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Writable Archives #757

wants to merge 1 commit into from

Conversation

bjornbytes
Copy link
Owner

@bjornbytes bjornbytes commented Mar 11, 2024

Adds the ability to mount an archive for writing. This means LÖVR can write anywhere on the filesystem, instead of only the save directory.

How it works: lovr.filesystem.mount takes a MountMode after the mountpoint. The mount mode can be either read (the default) or readwrite.

Filesystem functions that previously targeted the save directory (write, createDirectory, remove) will now use the virtual filesystem: they search through the mounted archives, find the first one in readwrite mode with a mountpoint that contains the input path, and write to that archive.

The save directory isn't special anymore -- its archive is just readwrite instead of read now.

I haven't tested this code very well yet.

@bjornbytes
Copy link
Owner Author

bjornbytes commented Mar 11, 2024

I found a bug in getSourceDirectory. If you do lovr ., getSourceDirectory returns . which is not a valid path to mount. It should be converted to an absolute path.

(Actually I'm not sure why that fails to mount, need to look into it).

Ah, it fails because . is already mounted...probably need to relax the logic for mounting duplicate archives now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant