API Reference › FileSystem
IGameFileSystem
InterfaceNamespace: SwiftlyS2.Shared.FileSystem · Assembly: SwiftlyS2.CS2.dll
public interface IGameFileSystemMethods
Adds a search path to the file system.
void AddSearchPath(string path, string pathId, SearchPathAdd_t addType, SearchPathPriority_t priority)Parameters
- pathstringThe path to add.
- pathIdstringThe ID of the path to add in.
- addTypeSearchPathAdd_tThe type of addition to perform.
- prioritySearchPathPriority_tThe priority of the search path.
Checks if a file exists at the given file path and path ID.
bool FileExists(string filePath, string pathId)Finds all files matching the given wildcard and path ID.
List<string> FindFileAbsoluteList(string wildcard, string pathId)Parameters
Gets the size of a file at the given file path and path ID.
uint GetFileSize(string filePath, string pathId)Parameters
Gets the search path(s) for the given path ID and search path type.
string GetSearchPath(string pathId, GetSearchPathTypes_t searchPathType, int searchPathsToGet)Parameters
- pathIdstringThe ID of the path to get the search paths for.
- searchPathTypeGetSearchPathTypes_tThe type of search path to get.
- searchPathsToGetintThe number of search paths to get.
Checks if a directory exists at the given path and path ID.
bool IsDirectory(string path, string pathId)Checks if a file is writable at the given file path and path ID.
bool IsFileWritable(string filePath, string pathId)Precaches a file at the given file path and path ID.
bool PrecacheFile(string filePath, string pathId)Parameters
Reads the contents of a file at the given file path and path ID.
string ReadFile(string filePath, string pathId)Parameters
Removes a search path from the file system.
bool RemoveSearchPath(string path, string pathId)Sets the writable status of a file at the given file path and path ID.
bool SetFileWritable(string filePath, string pathId, bool writable)Parameters
Writes content to a file at the given file path and path ID.
bool WriteFile(string filePath, string pathId, string content)Parameters