From 3042229aa2c0ab09da9826e30a9b620b5eb5ffce Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Tue, 30 Sep 2025 20:31:06 -0500 Subject: [PATCH] Ensuring the DosFileEntry is zeroed out when creating a new file. 'acx' actually pays attention to the file attributes. #192 --- .../applecommander/storage/os/dos33/DosFormatDisk.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java index b8ceff0a..eb8d685e 100644 --- a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java +++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/dos33/DosFormatDisk.java @@ -229,7 +229,11 @@ public class DosFormatDisk extends FormattedDisk { while (offset < 0xff) { // iterate through all entries int value = AppleUtil.getUnsignedByte(catalogSector[offset]); if (value == 0 || value == 0xff) { - return new DosFileEntry(this, track, sector, offset); + DosFileEntry fileEntry = new DosFileEntry(this, track, sector, offset); + byte[] entry = fileEntry.readFileEntry(); + Arrays.fill(entry, (byte)0); + fileEntry.writeFileEntry(entry); + return fileEntry; } offset+= DosFileEntry.FILE_DESCRIPTIVE_ENTRY_LENGTH; }