Class AbsEmuUnixFileHandle<T>
java.lang.Object
ghidra.pcode.emu.unix.AbstractEmuUnixFileHandle<T>
ghidra.pcode.emu.unix.AbsEmuUnixFileHandle<T>
- Type Parameters:
T- the type
- All Implemented Interfaces:
EmuUnixFileDescriptor<T>
A file descriptor for non-concrete types
-
Field Summary
Fields inherited from class AbstractEmuUnixFileHandle
arithmetic, file, flags, offsetBytes, userFields inherited from interface EmuUnixFileDescriptor
FD_STDERR, FD_STDIN, FD_STDOUT -
Constructor Summary
ConstructorsConstructorDescriptionAbsEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec, EmuUnixFile<T> file, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadvanceOffset(T len) Advance the handle's offset (negative to rewind)Returns the current offset of the file, or 0 if not applicable.longReturns the current offset of the file, or 0 if not applicable.protected booleanisPositive(T len) intRead from the file opened by this handlereadAbstract(T buf) Read from the file opened by this handlevoidseek(long offset) Seek to the given offsetvoidSeek to the given offsetintWrite into the file opened by this handlewriteAbstract(T buf) Write into the file opened by this handleMethods inherited from class AbstractEmuUnixFileHandle
checkReadable, checkWritable, close, getFile, stat
-
Constructor Details
-
AbsEmuUnixFileHandle
public AbsEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec, EmuUnixFile<T> file, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user)
-
-
Method Details
-
advanceOffset
Advance the handle's offset (negative to rewind)- Parameters:
len- the number of bytes to advance
-
isPositive
-
getAbstractOffset
Description copied from interface:EmuUnixFileDescriptorReturns the current offset of the file, or 0 if not applicable.- Returns:
- the current offset of the file, or 0 if not applicable
-
getOffset
public long getOffset()Description copied from interface:EmuUnixFileDescriptorReturns the current offset of the file, or 0 if not applicable.- Returns:
- the current offset of the file, or 0 if not applicable
-
seek
Description copied from interface:EmuUnixFileDescriptorSeek to the given offset- Parameters:
offset- the desired offset- Throws:
EmuIOException- if an error occurred
-
seek
Description copied from interface:EmuUnixFileDescriptorSeek to the given offset- Parameters:
offset- the desired offset- Throws:
EmuIOException- if an error occurred
-
readAbstract
Description copied from interface:EmuUnixFileDescriptorRead from the file opened by this handle- Parameters:
buf- the destination buffer- Returns:
- the number of bytes read
- Throws:
EmuIOException- if an error occurred
-
read
Description copied from interface:EmuUnixFileDescriptorRead from the file opened by this handle- Parameters:
buf- the destination buffer- Returns:
- the number of bytes read
- Throws:
EmuIOException- if an error occurred
-
writeAbstract
Description copied from interface:EmuUnixFileDescriptorWrite into the file opened by this handle- Parameters:
buf- the source buffer- Returns:
- the number of bytes written
- Throws:
EmuIOException- if an error occurred
-
write
Description copied from interface:EmuUnixFileDescriptorWrite into the file opened by this handle- Parameters:
buf- the source buffer- Returns:
- the number of bytes written
- Throws:
EmuIOException- if an error occurred
-