From 643de4b4b1dae21885e3d09f720acf499a082a8c Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Sat, 21 Oct 2023 13:54:04 -0500 Subject: [PATCH] Correcting `acx import` from an AppleSingle file to setup binary address correctly. #108 --- .../applecommander/acx/command/ImportCommand.java | 9 ++++++--- .../storage/os/prodos/ProdosFormatDisk.java | 13 ++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/cli-acx/src/main/java/io/github/applecommander/acx/command/ImportCommand.java b/app/cli-acx/src/main/java/io/github/applecommander/acx/command/ImportCommand.java index 0ce0e37..070da73 100644 --- a/app/cli-acx/src/main/java/io/github/applecommander/acx/command/ImportCommand.java +++ b/app/cli-acx/src/main/java/io/github/applecommander/acx/command/ImportCommand.java @@ -301,13 +301,16 @@ public class ImportCommand extends ReadWriteDiskCommandOptions { } ProdosFileInfo info = as.getProdosFileInfo(); String fileType = ProdosFormatDisk.getFiletype(info.getFileType()); - + OverrideFileEntryReader.Builder builder = OverrideFileEntryReader.builder(); builder.filename(Optional.ofNullable(as.getRealName())); + builder.prodosFiletype(fileType); + builder.locked((info.getAccess()&0xc2) != 0xc2); //Unlocked if destroy, rename and write are all enabled builder.fileData(as.getDataFork()); builder.resourceData(Optional.ofNullable(as.getResourceFork())); - builder.prodosFiletype(fileType); - builder.locked((info.getAccess()&0xc2) != 0xc2); //Unlocked if destory, rename and write are all enabled + if (ProdosFormatDisk.fileTypeNeedsAddress(fileType)) { + builder.binaryAddress(info.getAuxType()); + } builder.auxiliaryType(info.getAuxType()); if (as.getFileDatesInfo() != null) { diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java index 6b89c30..5686ab1 100644 --- a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java +++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java @@ -1286,7 +1286,7 @@ public class ProdosFormatDisk extends FormattedDisk { /** * Locate the associated ProdosFileType. */ - public static ProdosFileType findFileType(String filetype) { + static ProdosFileType findFileType(String filetype) { for (int i=0; i