Skip to content

IFileSystem interface

namespace: Serenity   assemblySerenity.Net.Core

Base file system abstraction for accessing the physical disk, allowing file and directory operations to be mocked or replaced.

public interface IFileSystem

Members

name description
CreateDirectory(…) Creates a directory.
CreateFile(…) Creates a file for writing, optionally overwriting it if it already exists.
DeleteDirectory(…) Deletes the directory at the specified path.
DeleteFile(…) Deletes the file at the specified path.
DirectoryExists(…) Checks whether a directory exists at the specified path.
FileExists(…) Checks whether a file exists at the specified path.
GetDirectories(…) Gets the directories at the specified path.
GetFiles(…) Gets the files at the specified path.
GetFileSize(…) Gets the size of the file at the specified path.
GetFullPath(…) Returns the absolute path for the specified path string.
GetLastWriteTimeUtc(…) Gets the last write time in UTC for the file at the specified path.
GetRelativePath(…) Returns a relative path from one path to another.
OpenRead(…) Opens the file at the specified path for reading.
ReadAllBytes(…) Reads all bytes from the file at the specified path.
ReadAllText(…) Reads all text from the file at the specified path.
WriteAllBytes(…) Writes all bytes to the file at the specified path.
WriteAllText(…) Writes content to the file at the specified path.

See Also