Class AbstractEmuUnixFileHandle<T>
java.lang.Object
ghidra.pcode.emu.unix.AbstractEmuUnixFileHandle<T>
- Type Parameters:
T- the type
- All Implemented Interfaces:
EmuUnixFileDescriptor<T>
- Direct Known Subclasses:
AbsEmuUnixFileHandle, DefaultEmuUnixFileHandle
public abstract class AbstractEmuUnixFileHandle<T>
extends Object
implements EmuUnixFileDescriptor<T>
Abstract for a file descriptor associated with a file on a simulated UNIX file system
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PcodeArithmetic<T> protected final EmuUnixFile<T> protected final Set<EmuUnixFileSystem.OpenFlag> protected final intprotected final EmuUnixUserFields inherited from interface EmuUnixFileDescriptor
FD_STDERR, FD_STDIN, FD_STDOUT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec, EmuUnixFile<T> file, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user) Construct a new handle on the given file -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the file is readable, throwingEmuIOExceptionif notvoidCheck if the file is writable, throwingEmuIOExceptionif notvoidclose()Close this descriptorgetFile()Get the file opened to this handlestat()Returns thestatstructure of the file opened by this handle.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmuUnixFileDescriptor
getAbstractOffset, getOffset, read, readAbstract, seek, seek, write, writeAbstract
-
Field Details
-
arithmetic
-
file
-
flags
-
user
-
offsetBytes
protected final int offsetBytes
-
-
Constructor Details
-
AbstractEmuUnixFileHandle
public AbstractEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec, EmuUnixFile<T> file, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user) Construct a new handle on the given file- Parameters:
machine- the machine emulating the hardwarecSpec- the ABI of the target platformfile- the file opened by this handleflags- the user-specified flags, as defined by the simulatoruser- the user that opened the file- See Also:
-
-
Method Details
-
getFile
-
checkReadable
public void checkReadable()Check if the file is readable, throwingEmuIOExceptionif not -
checkWritable
public void checkWritable()Check if the file is writable, throwingEmuIOExceptionif not -
stat
Description copied from interface:EmuUnixFileDescriptorReturns thestatstructure of the file opened by this handle.- Specified by:
statin interfaceEmuUnixFileDescriptor<T>- Returns:
- the
statstructure of the file opened by this handle
-
close
public void close()Description copied from interface:EmuUnixFileDescriptorClose this descriptor- Specified by:
closein interfaceEmuUnixFileDescriptor<T>
-