Skip to content

atariATR 1.6

Choose a tag to compare

@github-actions github-actions released this 30 Jul 13:26
· 7 commits to main since this release

Makes the file system plugin's image list manage itself — and fixes a data-loss
path that was present in 1.5.

Polski opis projektu: README.pl.md

Adding images by copying them

The WFX plugin shows the images listed in _LISTA-OBRAZOW.TXT, and until now
those paths had to be typed by hand. Now copying an .atr onto the plugin root
with F5 appends its path to the list
. The file stays where it is — only a
reference is recorded, so a 16 MB image is not duplicated. Repeating it changes
nothing, anything that is not a disk image is refused, and F6 (move) is refused
too: nothing was copied, so "moving" could only mean deleting your image.

F8 on an image in the root removes it from the list, leaving the file and
its contents alone.

The data-loss path this uncovered

A file manager has no recursive delete in the WFX API. Before removing something
that looks like a directory, it deletes the contents itself, file by file. An
image in the plugin root looks exactly like a directory — so F8 on it made
Double Commander delete every file inside the disk image, DOS.SYS included,
turning a bootable disk into an empty one. In 1.5 the closing FsRemoveDir then
failed, so you saw an error message next to an already emptied image.

The individual FsDeleteFile calls are indistinguishable from deliberately
deleting a file from a disk, so the path alone cannot tell the two apart. What
can is FsStatusInfo, which reports the directory an operation started in — the
plugin did not implement it before, which is why the information was missing:

  • delete started in the image list, target inside an image → skipped without
    touching anything (reported as success, so you do not get one error dialog per
    file), and the closing FsRemoveDir removes the list entry instead;
  • delete started inside an image → passed through, so deleting files and
    non-empty directories from a disk keeps working.

If a file manager does not report that context, nothing switches on: deletion
behaves as it always did and removing a list entry is refused with a message
pointing at F4. The convenience only appears where the guard actually protects
you.

An image shown by a directory entry has no line of its own, so F8 refuses it
rather than deleting the directory entry — that entry serves other images too.
There the refusal is honest: nothing would change, and you have a right to see
that the operation failed.

Verified in Double Commander: F8 on an image removes it from the list and
atrtool list on that file afterwards still shows every file inside.

Set AtrWfx.log next to the list file and the plugin appends the call sequence it
receives, which is how the above was measured.

File names: a series no longer collapses into one name

Copying a numbered series into an image used to ask about overwriting on every
file after the first. zmienne_01.wav, zmienne_02.wav, zmienne_03.wav all
became ZMIENNE0.WAV, because shortening to 8.3 simply cut the name at eight
characters — throwing away the digit that tells the files apart.

Shortening now keeps the digits at the end and truncates letters instead, so the
numbering survives and matches the source:

On disk Before Now
zmienne_01.wav ZMIENNE0.WAV ZMIENN01.WAV
zmienne_02.wav ZMIENNE0.WAV ZMIENN02.WAV
file_1234567890.wav FILE1234.WAV FILE7890.WAV
moj_plik-2.dat (SpartaDOS) MOJ_PLIK.DAT MOJ_PLI2.DAT

Copying eighteen such files now asks nothing at all.

When a shortened name has no digits to keep, its last character becomes a
hexadecimal index derived from the source name (BARDZOD8.DOK). Two names that
are identical for their first eight characters cannot both fit into 8.3 — no
algorithm changes that — but the index makes the 8.3 name a pure function of the
name on disk
. That matters more than it looks: with indices handed out in
arrival order instead, copying one corrected file from a pair would silently
overwrite the other one. Now every file has a fixed place and overwrites itself.

The index is computed from the base name without the extension, so files that
come in pairs stay paired: ZMIENN07.WAV and ZMIENN07.TAP. Directory names
follow the same rule, which stops two long directory names from silently merging.

Every conversion is reported — the file system plugin to the file manager's log
window, the packer plugin to its own log, atrtool add to the console — so you
can always tell which file became what.

Tests

The plugin harness used to call plugin functions directly, so it never reproduced
what a file manager actually does — which is why this defect could survive a green
test run. It now replays the whole sequence (FsStatusInfo → list → delete each
entry → FsRemoveDir) and requires the image contents to survive it, plus a
control case proving the guard is not too broad: a delete started inside an image
still removes files and non-empty directories. 92 checks, up from 57.

Test 5 (packer plugin) worked on the fixture images in place, so an interrupted
run corrupted the next one. It now works on copies, like the WFX test.

Name shortening has its own section (Test 3c): sixteen cases covering the digit
tail, the README table, both file systems, and the determinism the hash index is
there for — the same source name must produce the same 8.3 name in a different
image and in a different order. The WFX harness copies a series of eighteen files
through FsPutFile, one call each, and requires zero overwrite prompts.