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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this descriptorGet the current offset of the file, or 0 if not applicableRead from the file opened by this handlevoid
See to the given offsetstat()
Obtain thestat
structure of the file opened by this handleRead into the file opened by this handle
-
Field Details
-
FD_STDIN
static final int FD_STDINThe default file descriptor for stdin (standard input)- See Also:
-
FD_STDOUT
static final int FD_STDOUTThe default file descriptor for stdout (standard output)- See Also:
-
FD_STDERR
static final int FD_STDERRThe default file descriptor for stderr (standard error output)- See Also:
-
-
Method Details
-
getOffset
T getOffset()Get the current offset of the file, or 0 if not applicable- Returns:
- the offset
-
seek
See to the given offset- Parameters:
offset
- the desired offset- Throws:
EmuIOException
- if an error occurred
-
read
Read 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
Read into the file opened by this handle- Parameters:
buf
- the source buffer- Returns:
- the number of bytes written
- Throws:
EmuIOException
- if an error occurred
-
stat
EmuUnixFileStat stat()Obtain thestat
structure of the file opened by this handle -
close
void close()Close this descriptor
-