Interface IFileManager
- Namespace
- Whim
- Assembly
- Whim.dll
Manages files and directories for Whim.
public interface IFileManager
Properties
LogsDir
The path to the Whim logs directory.
string LogsDir { get; }
Property Value
SavedStateDir
The path to the saved state directory.
string SavedStateDir { get; }
Property Value
WhimDir
The path to the Whim directory.
string WhimDir { get; }
Property Value
Methods
DeleteFile(string)
Deletes the file at the given
filePath.void DeleteFile(string filePath)
Parameters
filePathstring
EnsureDirExists(string)
Ensures the given
dir exists. If it does not, it is created.void EnsureDirExists(string dir)
Parameters
dirstring- The directory to ensure exists.
FileExists(string)
Checks whether the given
filePath exists.bool FileExists(string filePath)
Parameters
filePathstring- The file path to check.
Returns
- bool
- Whether the file exists.
GetWhimFileDir(string)
Gets a file path in the Whim directory.
string GetWhimFileDir(string fileName)
Parameters
fileNamestring- The file name.
Returns
- string
- The file path.
GetWhimFileLogsDir(string)
Gets a file path in the Whim logs directory.
string GetWhimFileLogsDir(string fileName)
Parameters
fileNamestring- The file name.
Returns
- string
- The file path inside the logs directory.
OpenRead(string)
Opens an existing file for reading.
Stream OpenRead(string filePath)
Parameters
filePathstring- The file path.
Returns
- Stream
- The file stream.
ReadAllText(string)
Opens a text file, reads all the text in the file, and then closes the file.
string ReadAllText(string filePath)
Parameters
filePathstring- The file path.
Returns
- string
- A string containing all the text in the file.
WriteAllText(string, string)
WRites the given
contents to the given filePath.void WriteAllText(string filePath, string contents)