BadScript 2
Loading...
Searching...
No Matches
IFileSystem.cs
Go to the documentation of this file.
1namespace BadScript2.IO;
2
6public interface IFileSystem
7{
13
19 bool Exists(string path);
20
26 bool IsFile(string path);
27
33 bool IsDirectory(string path);
34
42 IEnumerable<string> GetFiles(string path, string extension, bool recursive);
43
50 IEnumerable<string> GetDirectories(string path, bool recursive);
51
57 void CreateDirectory(string path, bool recursive = false);
58
64 void DeleteDirectory(string path, bool recursive);
65
70 void DeleteFile(string path);
71
77 string GetFullPath(string path);
78
84 Stream OpenRead(string path);
85
92 Stream OpenWrite(string path, BadWriteMode mode);
93
99
104 void SetCurrentDirectory(string path);
105
112 void Copy(string src, string dst, bool overwrite = true);
113
120 void Move(string src, string dst, bool overwrite = true);
121}
Defines the interface for a file system.
Definition IFileSystem.cs:7
void SetCurrentDirectory(string path)
Sets the current Directory.
void DeleteDirectory(string path, bool recursive)
Deletes a directory.
bool IsDirectory(string path)
Returns true if the given path is a directory.
string GetCurrentDirectory()
Returns the Current Directory.
void CreateDirectory(string path, bool recursive=false)
Creates a new directory.
void Copy(string src, string dst, bool overwrite=true)
Copies a file or directory to a new location.
IEnumerable< string > GetDirectories(string path, bool recursive)
Returns all directories in the given directory.
Stream OpenWrite(string path, BadWriteMode mode)
Opens a file for writing.
IEnumerable< string > GetFiles(string path, string extension, bool recursive)
Returns all files in the given directory that match the specified extension.
string GetStartupDirectory()
The Startup Directory of the Application.
bool Exists(string path)
Returns true if the given path is a file or directory.
bool IsFile(string path)
Returns true if the given path is a file.
void Move(string src, string dst, bool overwrite=true)
Moves a file or directory to a new location.
string GetFullPath(string path)
Returns the full path of the given path.
void DeleteFile(string path)
Deletes a file.
Stream OpenRead(string path)
Opens a file for reading.
Contains IO Implementation for the BadScript2 Runtime.
BadWriteMode
The Write Modes of the File System Abstraction.