public class XfaFile
extends java.lang.Object
In a dir, the file header contains at offset the length of the file including the length of the file header (=Types.SMSEHeaderLength)
Modifier and Type | Field and Description |
---|---|
protected static int |
allocSize |
protected int |
deviceID |
protected java.nio.ByteBuffer |
dirBuffer |
protected java.lang.String[] |
driveNames |
protected int |
driveNumber |
protected java.io.File |
file |
protected java.lang.String |
filename |
protected int |
filenameChange |
protected int |
filePosition |
protected int |
freeSize |
protected XfaFileheader |
header |
protected int |
headerOffset |
protected java.nio.channels.FileChannel |
inoutChannel |
protected boolean |
isDir |
protected java.lang.String[] |
myFileNames |
protected java.io.File[] |
myFiles |
protected java.io.RandomAccessFile |
raFile |
protected boolean |
readOnly |
protected java.util.TimeZone |
timeZone |
protected int |
totalSize |
protected int |
usageName |
Constructor and Description |
---|
XfaFile(java.io.File file,
java.lang.String filename,
boolean isDir,
int driveNumber,
java.lang.String[] names,
int deviceID,
int filenameChange,
int usageName)
Create a directory "file" for read only access.
|
XfaFile(java.io.RandomAccessFile aFile,
java.nio.channels.FileChannel inoutChannel,
boolean lockTheFile,
java.io.File file,
java.lang.String filename,
boolean isDir,
int deviceID,
int driveNumber,
java.lang.String[] names,
int filenameChange,
int usageName)
Creates this object for any file that isn't a dir file.
|
Modifier and Type | Method and Description |
---|---|
void |
close(MC68000Cpu cpu)
Close this file : release file locks, if any and flush headers.
|
void |
flushHeader()
Flush the file header(write to disk).
|
java.lang.String |
getFilename()
Get the name of the file.
|
void |
handleTrap3(int trapKey,
int channelDefinitionBlock,
MC68000Cpu cpu,
java.lang.String nativeDir)
This dispatches the file I/O routines (=SMSQE TRAP#3 routines).
|
boolean |
isIsDir()
Checks whether this file is a dir.
|
void |
setAsDir()
Signals that this file should be treated as a dir.
|
protected java.io.RandomAccessFile raFile
protected java.nio.channels.FileChannel inoutChannel
protected XfaFileheader header
protected boolean isDir
protected java.io.File file
protected int driveNumber
protected int totalSize
protected int freeSize
protected static final int allocSize
protected java.io.File[] myFiles
protected java.lang.String[] myFileNames
protected int filePosition
protected java.lang.String[] driveNames
protected int deviceID
protected int headerOffset
protected java.lang.String filename
protected boolean readOnly
protected int filenameChange
protected int usageName
protected java.util.TimeZone timeZone
protected java.nio.ByteBuffer dirBuffer
public XfaFile(java.io.RandomAccessFile aFile, java.nio.channels.FileChannel inoutChannel, boolean lockTheFile, java.io.File file, java.lang.String filename, boolean isDir, int deviceID, int driveNumber, java.lang.String[] names, int filenameChange, int usageName)
aFile
- a java.io.RandomAccessFile
representing the true OS's file.inoutChannel
- a java.nio.channels.FileChannel
for that file.lockTheFile
- should we lock this file( granting execlusive access)?file
- a java.io.File
for the same file.filename
- the name of the file. This may be put to upper/lower case (NIY).deviceID
- the deviceID of the driver.isDir
- should be false
.driveNumber
- the number of the drive (eg. 0 for xFA1_ etc).names
- the names of subdrs, if any.filenameChange
- type of filename change (0,1,2).usageName
- usage name for this device.public XfaFile(java.io.File file, java.lang.String filename, boolean isDir, int driveNumber, java.lang.String[] names, int deviceID, int filenameChange, int usageName)
file
- the file to use.filename
- its filename.isDir
- should be true.names
- the names of the dirs the "drives" point to.driveNumber
- the number of he drive on which this file is (starting at 0).deviceID
- the deviceID of the driver.filenameChange
- type of filename change (0,1,2).usageName
- usage name for this device.public void close(MC68000Cpu cpu)
cpu
- the CPU object used for executing the program.public void handleTrap3(int trapKey, int channelDefinitionBlock, MC68000Cpu cpu, java.lang.String nativeDir)
trapKey
- what kind of trap#3 are we dealing with?channelDefinitionBlock
- = A0cpu
- the CPU.nativeDir
- the name of hte native dir this file belongs to (necessary for renaming).public boolean isIsDir()
true
if this file is a dir, false
if not.public void setAsDir()
public void flushHeader()
public java.lang.String getFilename()