mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-29 11:49:29 +00:00
write resource fork
This commit is contained in:
parent
ccbfc47a66
commit
2dff5a966c
@ -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;
|
||||
|
||||
|
@ -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 ();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user