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
|
abstract class CatalogEntry implements AppleFileSource
|
||||||
// -----------------------------------------------------------------------------------//
|
// -----------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
static String[] storageTypes = { "Del", "Sdl", "Sap", "Tre", "", "", "", "", "", "", "",
|
static String[] storageTypes = { "Del", "Sdl", "Sap", "Tre", "Pas", "Ext", "", "", "",
|
||||||
"", "", "DIR", "SDH", "VDH" };
|
"", "", "", "", "DIR", "SDH", "VDH" };
|
||||||
Disk disk;
|
Disk disk;
|
||||||
ProdosDisk parentDisk;
|
ProdosDisk parentDisk;
|
||||||
|
|
||||||
|
@ -209,11 +209,11 @@ public class ProdosDisk
|
|||||||
throws DiskFullException
|
throws DiskFullException
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
int blockNo = allocateNextBlock (); // allocate extended key block
|
||||||
|
|
||||||
FileWriter fileWriter = new FileWriter (this); // create resource fork
|
FileWriter fileWriter = new FileWriter (this); // create resource fork
|
||||||
fileWriter.writeFile (dataBuffer, eof);
|
fileWriter.writeFile (dataBuffer, eof);
|
||||||
|
|
||||||
int blockNo = allocateNextBlock ();
|
|
||||||
|
|
||||||
ExtendedKeyBlock extendedKeyBlock = new ExtendedKeyBlock (this, blockNo * BLOCK_SIZE);
|
ExtendedKeyBlock extendedKeyBlock = new ExtendedKeyBlock (this, blockNo * BLOCK_SIZE);
|
||||||
|
|
||||||
extendedKeyBlock.addMiniEntry (1, fileEntry.storageType, fileEntry.keyPointer,
|
extendedKeyBlock.addMiniEntry (1, fileEntry.storageType, fileEntry.keyPointer,
|
||||||
@ -223,6 +223,9 @@ public class ProdosDisk
|
|||||||
|
|
||||||
fileEntry.keyPointer = blockNo; // extended key block
|
fileEntry.keyPointer = blockNo; // extended key block
|
||||||
fileEntry.storageType = 0x05; // extended
|
fileEntry.storageType = 0x05; // extended
|
||||||
|
fileEntry.blocksUsed += fileWriter.blocksUsed + 1;
|
||||||
|
|
||||||
|
// fileEntry.eof ??
|
||||||
|
|
||||||
fileEntry.write ();
|
fileEntry.write ();
|
||||||
extendedKeyBlock.write ();
|
extendedKeyBlock.write ();
|
||||||
|
@ -138,6 +138,7 @@ public class NuFX
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
System.out.println ("Reading disk");
|
System.out.println ("Reading disk");
|
||||||
|
|
||||||
for (Record record : records)
|
for (Record record : records)
|
||||||
for (Thread thread : record.threads)
|
for (Thread thread : record.threads)
|
||||||
if (thread.hasDisk ())
|
if (thread.hasDisk ())
|
||||||
@ -148,6 +149,7 @@ public class NuFX
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
System.out.println ("Reading files");
|
System.out.println ("Reading files");
|
||||||
|
|
||||||
calculateTotalBlocks ();
|
calculateTotalBlocks ();
|
||||||
int[] diskSizes = { 280, 800, 1600, 3200, 6400, 65536 };
|
int[] diskSizes = { 280, 800, 1600, 3200, 6400, 65536 };
|
||||||
for (int diskSize : diskSizes) // in case we choose a size that is too small
|
for (int diskSize : diskSizes) // in case we choose a size that is too small
|
||||||
@ -194,7 +196,8 @@ public class NuFX
|
|||||||
if (record.hasResource ())
|
if (record.hasResource ())
|
||||||
{
|
{
|
||||||
buffer = record.getResourceData ();
|
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