write resource fork

This commit is contained in:
Denis Molony 2021-05-04 08:50:30 +10:00
parent ccbfc47a66
commit 2dff5a966c
3 changed files with 11 additions and 5 deletions

View File

@ -15,8 +15,8 @@ import com.bytezone.diskbrowser.utilities.Utility;
abstract class CatalogEntry implements AppleFileSource
// -----------------------------------------------------------------------------------//
{
static String[] storageTypes = { "Del", "Sdl", "Sap", "Tre", "", "", "", "", "", "", "",
"", "", "DIR", "SDH", "VDH" };
static String[] storageTypes = { "Del", "Sdl", "Sap", "Tre", "Pas", "Ext", "", "", "",
"", "", "", "", "DIR", "SDH", "VDH" };
Disk disk;
ProdosDisk parentDisk;

View File

@ -209,11 +209,11 @@ public class ProdosDisk
throws DiskFullException
// ---------------------------------------------------------------------------------//
{
int blockNo = allocateNextBlock (); // allocate extended key block
FileWriter fileWriter = new FileWriter (this); // create resource fork
fileWriter.writeFile (dataBuffer, eof);
int blockNo = allocateNextBlock ();
ExtendedKeyBlock extendedKeyBlock = new ExtendedKeyBlock (this, blockNo * BLOCK_SIZE);
extendedKeyBlock.addMiniEntry (1, fileEntry.storageType, fileEntry.keyPointer,
@ -223,6 +223,9 @@ public class ProdosDisk
fileEntry.keyPointer = blockNo; // extended key block
fileEntry.storageType = 0x05; // extended
fileEntry.blocksUsed += fileWriter.blocksUsed + 1;
// fileEntry.eof ??
fileEntry.write ();
extendedKeyBlock.write ();

View File

@ -138,6 +138,7 @@ public class NuFX
{
if (debug)
System.out.println ("Reading disk");
for (Record record : records)
for (Thread thread : record.threads)
if (thread.hasDisk ())
@ -148,6 +149,7 @@ public class NuFX
{
if (debug)
System.out.println ("Reading files");
calculateTotalBlocks ();
int[] diskSizes = { 280, 800, 1600, 3200, 6400, 65536 };
for (int diskSize : diskSizes) // in case we choose a size that is too small
@ -194,7 +196,8 @@ public class NuFX
if (record.hasResource ())
{
buffer = record.getResourceData ();
System.out.println (HexFormatter.format (buffer));
// System.out.println (HexFormatter.format (buffer));
disk.addResourceFork (fileEntry, buffer, buffer.length);
}
}
}