Skip to content

Undelete, attributes, volume label, pack/unpack folders - #3

Merged
VC-Anvil merged 2 commits into
masterfrom
claude/pack-unpack-undelete
Nov 4, 2026
Merged

VC-Anvil merged 2 commits into
masterfrom
claude/pack-unpack-undelete

Conversation

@VC-Anvil

@VC-Anvil VC-Anvil commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #2: fills in the "deleted-entry recovery" the README already advertised and adds folder-level import/export.

Core (Fat12)

  • undelete(e, firstLetter): recovers a deleted file the way MSX-DOS UNDEL does (contiguous clusters from the start cluster); refuses when any cluster was reused or a live file now has the name.
  • setAttributes(e, attr): R/H/S/A bits, directory/volume bits preserved.
  • setVolumeLabel(label): create / replace / remove the root VOL entry; volume entries now list as their 11-character label.
  • suggestName83(hostName, taken): valid unique 8.3 name from any host name (My Long Program.bas → MYLONG~1.BAS).

CLI

  • pack <hostdir> <out.dsk> [360|720] [--label L] and unpack <img> <hostdir> (whole tree, loop-safe). cli/hostfs.h avoids std::filesystem so the macOS 10.13 build keeps working.
  • undelete, attrib, label.
  • add without an explicit NAME derives an 8.3 name; since Core test suite + FAT12/BASIC/DMK/ROM/CLI correctness fixes #2 validates names, long host names were being rejected.

GUI

  • Add file derives the 8.3 name the same way (same regression).
  • Undelete button (with the lost first letter) on deleted entries.

Testing

  • 73 core tests (undelete incl. reused-cluster/name-collision/subdirectory cases, attributes, labels, name derivation) + cli_smoke extended with pack → unpack, attrib, label, del → undelete; all green locally, also under ASan/UBSan.
  • MinGW (Windows) and GUI builds compile without warnings; GUI changes not exercised interactively.

https://claude.ai/code/session_01CtBtjm9PRm6sDhDVJbtciC


Generated by Claude Code

- undelete() recovers a deleted file the way MSX-DOS UNDEL does
  (contiguous clusters from the start cluster), refusing when any of
  them was reused or a live file took the name. The README already
  advertised "deleted-entry recovery"; only listing existed.
- setAttributes() sets R/H/S/A, keeping the directory/volume bits.
- setVolumeLabel() creates, replaces or removes the root VOL entry;
  volume entries are listed as their 11-char label (no 8.3 dot).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtBtjm9PRm6sDhDVJbtciC
- pack <hostdir> <out.dsk>: build a 360/720K disk from a folder tree
  (optional --label); unpack <img> <dir>: extract the whole tree.
  cli/hostfs.h lists host directories without std::filesystem, so the
  macOS 10.13 target still builds.
- undelete, attrib (+R/-R/+H/-H/+S/-S/+A/-A) and label commands.
- Fat12::suggestName83() derives a valid, unique 8.3 name from a host
  name (MYPROG~1.BAS). `add` without NAME and the GUI's "Add file"
  use it: since names are validated, long host names were rejected.
- GUI: "Undelete" (with the lost first letter) on deleted entries.
- cli_smoke covers pack -> unpack, attrib, label, del -> undelete and
  derived names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtBtjm9PRm6sDhDVJbtciC
@VC-Anvil
VC-Anvil merged commit 6562176 into master Nov 4, 2026
4 checks passed
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.

2 participants