Skip to content

fix: resume interrupted dumps by checking existing file size#135

Open
Ghostedworld wants to merge 1 commit into
LightningMods:mainfrom
Ghostedworld:main
Open

fix: resume interrupted dumps by checking existing file size#135
Ghostedworld wants to merge 1 commit into
LightningMods:mainfrom
Ghostedworld:main

Conversation

@Ghostedworld

Copy link
Copy Markdown

Problem

When a dump is interrupted (power loss, crash, etc.), restarting
requires dumping the entire game from scratch even though most files
were already copied to USB.

The existing file-exists check in pfs.cpp had an uninitialized
variable bug — bytes was used before being assigned, causing
incorrect progress accounting.

Fix

  • If a file already exists on USB and matches the expected size → skip it
  • If a file exists but is smaller than expected (partial write) → delete and redo just that file
  • All previously completed files are skipped correctly on resume

Result

Interrupted dumps resume from where they stopped instead of
restarting from 0%.

Note

Untested on hardware due to lack of build environment.
Logic reviewed carefully — looking for someone to verify on device.

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.

1 participant