Skip to content

Let the user choose where temporary work files go - #3

Open
kopihitam wants to merge 1 commit into
itsmemac:mainfrom
kopihitam:feature/custom-temp-folder
Open

kopihitam wants to merge 1 commit into
itsmemac:mainfrom
kopihitam:feature/custom-temp-folder

Conversation

@kopihitam

Copy link
Copy Markdown

Closes #2

Problem

Converting an image (for example exFAT to ZArchive), converting a package to an image, and editing the details of an FFPFSC image or a package all unpack the whole game first. Those work files always went to the system temporary folder, so a big game could fill the C: drive and the job failed with "disk full".

What changes

  • Settings > Output and naming > Temporary folder, with Browse. Blank keeps the system temporary folder, so nothing changes for people who don't set it.
  • "Keep temporary files next to the output instead": work files go in a .Packwright-<job>-<id> folder beside the output, on the same drive. This is the same naming the exFAT and FFPKG edit staging already use. Ticking it greys out the folder box.
  • Command line: jobs follow the saved setting, and --temp <folder> overrides it for one run (listed in help).
  • No silent fallback: if the chosen folder can't be created, the job fails with a message naming the folder instead of writing to the system drive. Only each job's own subfolder is deleted, never the folder the user chose.
  • Library scan: files inside .Packwright-* work folders are skipped, so a half-unpacked game or an image copy sitting next to an output isn't listed as a title. This also covers the existing .Packwright-exfat-edit- and .Packwright-ffpkg-edit- folders.
  • The setting takes effect as soon as Settings is saved, without a restart.

The shared helper is TemporaryFolders in Packwright.Containers. It's set up the same way as the key file: the app configures it from settings at startup and on every settings change, and the command line configures it before running a job.

Not changed: the unused ToolPreset.TempDirectory field is left in place so old settings files still load (presets never hold paths), and ProsperoPfsImage.VerifyRoundTrip still uses system temp because nothing calls it.

Testing

  • New smoke test, 13 checks, no game needed (it builds a small dump):
    dotnet run --project tests/Packwright.SmokeTests -c Release -- temp-folders <work folder>
    
    It covers where job folders are made, exFAT to ZArchive conversion with a chosen folder and next to the output (nothing left behind), conversion and details edit failing on an unusable folder, and the library scan skipping work folders.
  • Command line checked by hand with a good and a bad --temp, a saved folder, and the "next to the output" setting.
  • The Settings screen was rendered and driven offscreen with Avalonia.Headless (15 checks): the controls, the greying out, the full-path check, saving, applying straight away, and reopening.
  • Not tested: package-to-image conversion and editing a real package, because those need an actual PS5 package.

🤖 Generated with Claude Code

Converting an image, converting a package to an image, and editing the
details of an FFPFSC image or a package unpack the whole game first. That
always went to the system temporary folder, which could fill the C: drive.

- Settings > Temporary folder picks another folder; blank keeps the system
  temporary folder. "Keep temporary files next to the output instead" puts
  them in a .Packwright-* folder beside the output, on the same drive.
- The command line follows the setting, and --temp <folder> overrides it.
- A folder that cannot be created fails the job with a message naming it,
  instead of falling back to the system drive. Only each job's own
  subfolder is deleted, never the chosen folder.
- The library scan skips .Packwright-* work folders, so a half-unpacked
  game next to an output is not listed as a title.
- New smoke test: SmokeTests temp-folders <work folder>.

Closes itsmemac#2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Change temp folder to the one I desire

1 participant