Repository navigation
Platform-independent exFAT: pure-Python writer/reader, one-pass pack folder, deep read - #65
Conversation
|
I've merged a couple of PRs you sent @rdmrocha , but now we have conflicts on this one. Can you please take a look when you have time? Once this one is merged, I will do a couple of tests and release a new version. Thanks for all the contibutions you are making in the the last few weeks. |
Rebased against your latest master. |
|
I am working into merge his into the main branch. I implemented a few changes to solve issues I faced when converting using an external drive. I also implemented the exFAT support for the verify, unpack and tree commands. Sadly the latest commit you did has a conflict with my changes; now I am trying to solve the confict |
Why
Producing an exFAT-wrapped game image today depends on the host OS and elevated privileges: it shells out to
newfs_exfat/mkfs.exfat, mounts a loopback/disk image (losetup/hdiutil/OSFMount), copies files in as root/admin, and unmounts.That means three divergent code paths, external tools that must be installed, and admin rights — and it cannot run unprivileged or on a machine without the right filesystem tooling. It also forces a two-step workflow (build a full
.exfat, then compress it), so peak disk is roughly double the game size while both the intermediate image and the output exist.This PR removes all of that. exFAT is built and read entirely in pure Python — no mount, no root, no external binaries — identically on macOS, Linux, and Windows, and the folder→
.ffpfscpath runs in a single streaming pass with no temporary.exfaton disk.mkpfs pack folder ./game ./game.ffpfscnow wraps the folder in an exFAT and compresses it straight into the.ffpfscin one pass.New commands and flags
pack folder(default): folder → exFAT →.ffpfscin one pass, no temp image.pack folder --raw: pack the folder directly as PFS (the previous default).pack exfat <dir> [out]: build a raw.exfatimage (auto-named<titleId>.exfat).unpack --deep: extract the files inside a wrapped exFAT, not the inner.exfat.tree --deep: list the files inside a wrapped exFAT.How it works
.ffpfsccan be peeled to its inner contents without writing a temp.exfat.<titleId>.exfatfromsce_sys/param.json..DS_Store,._*,__MACOSX,Thumbs.db, …) is excluded consistently across packing, the AMPR index, and verify.Disk and speed
source + output(no inner.exfat, no doubling).Validation
fsck_exfat-clean, and mounts/reads correctly under the macOS kernel driver.Notes
--rawfor signed PFS images.Dependencies
This branch is stacked on two PRs and should be merged after both: