Package ghidra.pcode.emu.unix
Class AbstractEmuUnixFileSystem<T>
java.lang.Object
ghidra.pcode.emu.unix.AbstractEmuUnixFileSystem<T>
- Type Parameters:
- T- the type of values stored in the file system
- All Implemented Interfaces:
- EmuUnixFileSystem<T>
- Direct Known Subclasses:
- BytesEmuUnixFileSystem
An abstract emulated file system, exported to an emulated user-space program
- 
Nested Class SummaryNested classes/interfaces inherited from interface ghidra.pcode.emu.unix.EmuUnixFileSystemEmuUnixFileSystem.OpenFlag
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateOrGetFile(String pathname, int mode) Get the named file, creating it if it doesn't already existGet the named fileabstract AbstractEmuUnixFile<T> A factory for constructing a new file (without adding it to the file system)open(String pathname, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user, int mode) Open the requested file according to the given flags and uservoidputFile(String pathname, EmuUnixFile<T> file) Place the given file at the given locationvoidunlink(String pathname, EmuUnixUser user) Remove the file at the given location
- 
Field Details- 
filesByPath
 
- 
- 
Constructor Details- 
AbstractEmuUnixFileSystempublic AbstractEmuUnixFileSystem()
 
- 
- 
Method Details- 
newFileDescription copied from interface:EmuUnixFileSystemA factory for constructing a new file (without adding it to the file system)- Specified by:
- newFilein interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the path of the file
- mode- the mode of the new file
- Returns:
- the new file
- Throws:
- EmuIOException- if the file cannot be constructed
 
- 
createOrGetFileDescription copied from interface:EmuUnixFileSystemGet the named file, creating it if it doesn't already existThis is accessed by the emulator user, not the target program. - Specified by:
- createOrGetFilein interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the pathname of the requested file
- mode- the mode of a created file. Ignored if the file exists
- Returns:
- the file
- Throws:
- EmuIOException- if an error occurred
 
- 
getFileDescription copied from interface:EmuUnixFileSystemGet the named fileThis is accessed by the emulator user, not the target program. - Specified by:
- getFilein interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the pathname of the requested file
- Returns:
- the file, or nullif it doesn't exist
- Throws:
- EmuIOException- if an error occurred
 
- 
putFileDescription copied from interface:EmuUnixFileSystemPlace the given file at the given locationThis is accessed by the emulator user, not the target program. If the file already exists, it is replaced silently. - Specified by:
- putFilein interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the pathname of the file
- file- the file, presumably having the same pathname
- Throws:
- EmuIOException- if an error occurred
 
- 
openpublic EmuUnixFile<T> open(String pathname, Set<EmuUnixFileSystem.OpenFlag> flags, EmuUnixUser user, int mode) throws EmuIOException Description copied from interface:EmuUnixFileSystemOpen the requested file according to the given flags and userThis is generally accessed by the target program via a DefaultEmuUnixFileHandle.- Specified by:
- openin interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the pathname of the requested file
- flags- the requested open flags
- user- the user making the request
- mode- the mode to assign the file, if created. Otherwise ignored
- Returns:
- the file
- Throws:
- EmuIOException- if an error occurred, e.g., file not found, or access denied
 
- 
unlinkDescription copied from interface:EmuUnixFileSystemRemove the file at the given locationTODO: Separate the user-facing routine from the target-facing routine. If the file does not exist, this has no effect. - Specified by:
- unlinkin interface- EmuUnixFileSystem<T>
- Parameters:
- pathname- the pathname of the file to unlink
- user- the user requesting the unlink
- Throws:
- EmuIOException- if an error occurred
 
 
-