Package ghidra.pcode.emu.unix
Interface EmuUnixFileDescriptor<T>
- Type Parameters:
- T- the type of values stored in the file
- All Known Implementing Classes:
- AbstractStreamEmuUnixFileHandle,- DefaultEmuUnixFileHandle,- IOStreamEmuUnixFileHandle
public interface EmuUnixFileDescriptor<T>
A process's handle to a file (or other resource)
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close this descriptorGet the current offset of the file, or 0 if not applicableRead from the file opened by this handlevoidSee to the given offsetstat()Obtain thestatstructure of the file opened by this handleRead into the file opened by this handle
- 
Field Details- 
FD_STDINstatic final int FD_STDINThe default file descriptor for stdin (standard input)- See Also:
 
- 
FD_STDOUTstatic final int FD_STDOUTThe default file descriptor for stdout (standard output)- See Also:
 
- 
FD_STDERRstatic final int FD_STDERRThe default file descriptor for stderr (standard error output)- See Also:
 
 
- 
- 
Method Details- 
getOffsetT getOffset()Get the current offset of the file, or 0 if not applicable- Returns:
- the offset
 
- 
seekSee to the given offset- Parameters:
- offset- the desired offset
- Throws:
- EmuIOException- if an error occurred
 
- 
readRead from the file opened by this handle- Parameters:
- buf- the destination buffer
- Returns:
- the number of bytes read
- Throws:
- EmuIOException- if an error occurred
 
- 
writeRead into the file opened by this handle- Parameters:
- buf- the source buffer
- Returns:
- the number of bytes written
- Throws:
- EmuIOException- if an error occurred
 
- 
statEmuUnixFileStat stat()Obtain thestatstructure of the file opened by this handle
- 
closevoid close()Close this descriptor
 
-