functions Methods 24

CreateDirectory (folder)
Create a directory - or a tree of directories. Returns silently if the directory already exists.
CreateSubSystem (path)
BaseFileSystem
Create a sub-filesystem at the specified path
DeleteDirectory (folder, recursive)
Delete a folder and optionally all of its contents
DeleteFile (path)
Delete a file
DirectoryExists (path)
bool
Returns true if the directory exists on this filesystem
DirectorySize (path, recursive)
int
Gets the size in bytes of all the files in a directory
FileExists (path)
bool
Returns true if the file exists on this filesystem
FileSize (filepath)
long
Returns file size of given file.
FindDirectory (folder, pattern, recursive)
IEnumerable`1
Get a list of directories
FindFile (folder, pattern, recursive)
IEnumerable`1
Get a list of files
GetCrc (filepath)
UInt64
Returns CRC64 of the file contents.
GetCrcAsync (filepath)
Task`1
Returns CRC64 of the file contents.
GetFullPath (path)
string
Returns the full physical path to a file or folder on disk, or null if it isn't on disk.
OpenRead (path, mode)
Stream
Open a file for read. Will throw an exception if it doesn't exist.
OpenWrite (path, mode)
Stream
Open a file for write. If the file exists we'll overwrite it (by default)
ReadAllBytes (path)
Span`1
Read the contents of path and return it as a string
ReadAllBytesAsync (path)
Task`1
Read the contents of path and return it as a string
ReadAllText (path)
string
Read the contents of path and return it as a string. Returns null if file not found.
ReadAllTextAsync (path)
Task`1
Read the contents of path and return it as a string
ReadJson (filename, defaultValue)
T
Read Json from a file using System.Text.Json.JsonSerializer. This will throw exceptions if not valid json.
ReadJsonOrDefault (filename, returnOnError)
T
The same as ReadJson except will return a default value on missing/error.
WriteAllBytes (path, contents)
Write the contents to the path. The file will be over-written if the file exists
WriteAllText (path, contents)
Write the contents to the path. The file will be over-written if the file exists
WriteJson (filename, data)
Convert object to json and write it to the specified file
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.