Skip to content

Load imperfect images and allow non-standard file names (#11, #12) - #13

Open
TobyLobster wants to merge 1 commit into
monkeyman79:masterfrom
TobyLobster:master
Open

TobyLobster wants to merge 1 commit into
monkeyman79:masterfrom
TobyLobster:master

Conversation

@TobyLobster

Copy link
Copy Markdown

Issue #11 - images that fail to open:

  • An image whose size is not a multiple of 256 bytes (incomplete last sector) is now loaded with the last sector padded, instead of failing with "invalid disk image size".
  • An image that is shorter than the catalog implies no longer fails with "disk image too small". Previously an invalid catalog (e.g. a non-standard sector count such as 293 or 320) made dfsimage demand a full-size image even when all file data was present. The check now uses the extents of the catalog entries; missing data reads as empty (0xE5) sectors, as in emulators, with a ValidationWarning.
  • An image too short to hold the catalog is still an error.

Issue #12 - non-standard characters in file names:

  • New Image.allow_invalid_names setting (class default, per-instance, or allow_invalid_names= on Image(), Image.open() and Image.create()), and a --allow-invalid-names CLI flag. When set, file and directory names containing 7-bit codes outside 32-126 (e.g. control codes used for copy protection) can be created, renamed and imported with one warning per name. Codes 128+ are still rejected. The default is unchanged.
  • Inf file names keep leading/trailing whitespace-class characters such as form feed, which are part of such names.

Also fixes inf files being ignored on import unless the current working directory was the directory containing them.

Claude-Session: https://claude.ai/code/session_01QHzHRcSa5fqh4a17f2Uy2k

…, monkeyman79#12)

Issue monkeyman79#11 - images that fail to open:
- An image whose size is not a multiple of 256 bytes (incomplete last
  sector) is now loaded with the last sector padded, instead of failing
  with "invalid disk image size".
- An image that is shorter than the catalog implies no longer fails with
  "disk image too small". Previously an invalid catalog (e.g. a
  non-standard sector count such as 293 or 320) made dfsimage demand a
  full-size image even when all file data was present. The check now uses
  the extents of the catalog entries; missing data reads as empty (0xE5)
  sectors, as in emulators, with a ValidationWarning.
- An image too short to hold the catalog is still an error.

Issue monkeyman79#12 - non-standard characters in file names:
- New Image.allow_invalid_names setting (class default, per-instance, or
  allow_invalid_names= on Image(), Image.open() and Image.create()), and
  a --allow-invalid-names CLI flag. When set, file and directory names
  containing 7-bit codes outside 32-126 (e.g. control codes used for copy
  protection) can be created, renamed and imported with one warning per
  name. Codes 128+ are still rejected. The default is unchanged.
- Inf file names keep leading/trailing whitespace-class characters such
  as form feed, which are part of such names.

Also fixes inf files being ignored on import unless the current working
directory was the directory containing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHzHRcSa5fqh4a17f2Uy2k
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