Skip to content

Commit

Permalink
Implement writing to archives (Astrabit-ST#78)
Browse files Browse the repository at this point in the history
* feat: implement temporary file creation (native and web)

* perf: back archiver files with temp files instead of cursors

* perf: archiver now uses a trie to cache paths

* fix: trie needs to create parent when removing dirs

* style: remove redundant `use`

Blame my language server for whatever this is.

* fix: fix trie edge cases

* style: remove `Arc` from `FileSystemTrie`

* refactor: temporary file creation now returns `std::io::Result`

* feat: implement archive file writing for RMXP and RMVX

* fix: archive file flush now preserves temp file stream pos

* style: `decrypt_file` now returns a file instead of an iterator

* chore: fix web build compilation errors

* fix: fix list filesystem's file creation semantics

The list filesystem should only create files in filesystems where the
parent directory of the file exists.

* feat: implement file truncation

* perf: optimize operations needed to write to archives

* style: rename misleading argument in `read_file_xor`

* perf: don't flush archives unless modified

* refactor: `File::metadata` now returns `std::io::Result`

* refactor: remove all unsafe unwraps from the web filesystem

* feat: implement `ExactSizeIterator` for `FileSystemTrieIter`

* feat: implement archive file writing for RMVXA

* feat: update the trie after writing to the archive

* chore: fix misleading comment in trie.rs

* fix: mark files as modified when truncating

* feat: implement file creation in archives

* refactor: move archive file truncation into utility function

* refactor: add utility function `as_file` to files

* refactor: store file header offsets

* fix: fix edge cases for RMVXA archives in `move_file_and_truncate`

* feat: implement removing files and dirs in archives

* fix: fix edge case in `FileSystemTrieIter`

* fix: don't allow file truncation without write access

* feat: implement renaming files in archives

* feat: implement directory creation in archives

* refactor: split archiver filesystem into smaller files

* style: remove unnecessary generics

* chore: satiate clippy, the all-seeing

* style: `&mut impl Read` -> `impl Read`

* style: remove `&mut` from `read_file_xor` as well
  • Loading branch information
white-axe authored Dec 22, 2023
1 parent bb820ee commit a7cd8c4
Show file tree
Hide file tree
Showing 16 changed files with 1,881 additions and 367 deletions.
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion crates/filesystem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ tracing.workspace = true

luminol-config.workspace = true

rand.workspace = true

iter-read = "1.0.1"
qp-trie = "0.8.2"

[target.'cfg(windows)'.dependencies]
winreg = "0.51.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tempfile = "3.8.1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
once_cell.workspace = true
rand.workspace = true
slab.workspace = true

luminol-web = { version = "0.4.0", path = "../web/" }
Expand All @@ -69,4 +76,8 @@ web-sys = { version = "0.3", features = [
"FileSystemRemoveOptions",
"FileSystemWritableFileStream",
"WritableStream",

"Navigator",
"StorageManager",
"Window",
] }
Loading

0 comments on commit a7cd8c4

Please sign in to comment.