generated from emilk/eframe_template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement writing to archives #78
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blame my language server for whatever this is.
The list filesystem should only create files in filesystems where the parent directory of the file exists.
melody-rs
approved these changes
Dec 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I've implemented writing to files, renaming files and creating and removing files and directories inside of archives. The performance characteristics are predictably quite poor so I'm still making an archive manager that will use these features more efficiently.
As an optimization, when a file within an archive is written to and the length of the file has changed, the file is moved to the end of the archive so that subsequent writes to the same file will take less time. If the file length hasn't changed, the file will be written to in-place.
This pull request also comes with additional features for the host (native and web) filesystems:
set_len
, for extending and truncating files, because writing to an archive may reduce its size.Testing
Try saving to an RPG Maker XP project without archives first just to make sure saving to this project normally works. Make sure to modify one of the maps by drawing tiles or moving around events, otherwise no files will be written!
Once that is confirmed to work, create an archive containing the Data and Graphics directories in the project using RPG Maker XP or some third-party tool. Move the archive into the root directory of the project and delete the original Data and Graphics directories. Then try loading and saving again (after modifying the project).
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
cargo build --release
trunk build --release