Skip to content

Adding files to ProDOS image does not overwrite existing files #53

@gray-space

Description

@gray-space

A new wrinkle in developing a workflow for editing on a modern system and compiling within an emulator. If you tell ac to add a file to an image that already has a file with that name, it will add a new file with the same name rather than overwriting the existing file. For example:

$ ac -p test.po collar.jpg BIN < collar.jpg 
$ $ ac -ll test.po
test.po /TEST/
  COLLAR.JPG  Destroy Read Rename Write BIN  792 04/04/2021 08:26 04/04/2021 08:26 402,479 A=$2000 0002 0109 Tree  0 0
ProDOS format; 410,112 bytes free; 409,088 bytes used.
$ ac -p test.po collar.jpg BIN < collar.jpg 
$ ac -ll test.po 
test.po /TEST/
  COLLAR.JPG  Destroy Read Rename Write BIN  792 04/04/2021 08:26 04/04/2021 08:26 402,479 A=$2000 0002 0109 Tree  0 0
  COLLAR.JPG  Destroy Read Rename Write BIN  792 04/04/2021 08:26 04/04/2021 08:26 402,479 A=$2000 0002 0421 Tree  0 0
ProDOS format; 4,608 bytes free; 814,592 bytes used.

This also happens for -pt and -ptx.

I've not tested other image formats like DOS 3.3. So, this may be isolated to ProDOS.

Interestingly, nothing in ProDOS seems to mind multiple identically-named files... the shell I am using on the Apple II seems perfectly content to access one of the copies of the file. If I use a command to delete a file with the duplicate filename, it deletes one copy and leaves the other in place. Telling ac to delete the filename from the image does the same: it deletes one copy and leaves the other one there.

This isn't a huge issue, as I'll just have the script I've written to update files in the ProDOS image check for an existing copy of a file and delete it before adding an updated copy. But it might confuse people who are expecting that adding a file to an image will overwrite an existing file in the image, rather than creating a duplicate with the same name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions