Class DefaultEmuUnixFileHandle<T>
java.lang.Object
ghidra.pcode.emu.unix.AbstractEmuUnixFileHandle<T>
ghidra.pcode.emu.unix.DefaultEmuUnixFileHandle<T>
- Type Parameters:
T- the type of values stored in the file
- All Implemented Interfaces:
EmuUnixFileDescriptor<T>
A concrete file descriptor
-
Field Summary
Fields inherited from class AbstractEmuUnixFileHandle
arithmetic, file, flags, offsetBytes, userFields inherited from interface EmuUnixFileDescriptor
FD_STDERR, FD_STDIN, FD_STDOUT -
Constructor Summary
ConstructorsChangeConstructorDescriptionDefaultEmuUnixFileHandle(PcodeMachine<T> machine, CompilerSpec cSpec, EmuUnixFile<T> file, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user) Construct a new handle on the given fileREMOVEDRemovedREMOVEDfile() RemovedREMOVEDflags() RemovedREMOVEDuser() RemovedREMOVEDRemoved -
Method Summary
ChangeModifier and TypeMethodDescriptionReturns the current offset of the file, or 0 if not applicable.longReturns the current offset of the file, or 0 if not applicable.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 handleREMOVEDEmuUnixFile<T>getFile() RemovedREMOVEDvoidRemovedREMOVEDvoidRemovedREMOVEDvoidadvanceOffset(T len) RemovedREMOVEDEmuUnixFileStatstat() RemovedREMOVEDvoidclose() RemovedMethods inherited from class AbstractEmuUnixFileHandle
checkReadable, checkWritable, close, getFile, stat
-
Constructor Details
-
DefaultEmuUnixFileHandle
public DefaultEmuUnixFileHandle(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
-
getOffset MODIFIED
public long getOffset()return type: T → long-T getOffset()+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
-
getAbstractOffset NEW
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 NEW
Description copied from interface:EmuUnixFileDescriptorSeek to the given offset- Parameters:
offset- the desired offset- Throws:
EmuIOException- if an error occurred
-
read MODIFIED
return type: T → int-T read(T buf) throws EmuIOException+int read(T buf) throws EmuIOExceptionDescription 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
-
readAbstract NEW
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
-
write MODIFIED
return type: T → int-T write(T buf) throws EmuIOException+int write(T buf) throws EmuIOExceptionDescription 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
-
writeAbstract NEW
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
-