Ensuring the DosFileEntry is zeroed out when creating a new file. 'acx' actually pays attention to the file attributes. #192

This commit is contained in:
Rob Greene
2025-09-30 20:31:06 -05:00
parent 19dcc29b81
commit 3042229aa2

View File

@@ -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;
}