2using System.Collections.Generic;
5using System.Threading.Tasks;
55 Task<bool>
PathIsChildOf(
string parentPath,
string childPath, CancellationToken cancellationToken);
68 IEnumerable<string>? ignore,
69 Func<string, string, ValueTask>? postCopyCallback,
73 CancellationToken cancellationToken);
81 Task<bool>
FileExists(
string path, CancellationToken cancellationToken);
98 ValueTask<byte[]>
ReadAllBytes(
string path, CancellationToken cancellationToken);
106 Task<IReadOnlyList<string>>
GetDirectories(
string path, CancellationToken cancellationToken);
114 Task<IReadOnlyList<string>>
GetFiles(
string path, CancellationToken cancellationToken);
137 ValueTask
WriteAllBytes(
string path,
byte[] contents, CancellationToken cancellationToken);
146 ValueTask
CopyFile(
string src,
string dest, CancellationToken cancellationToken);
164 Task<List<string>>
GetFilesWithExtension(
string path,
string extension,
bool recursive, CancellationToken cancellationToken);
172 Task
DeleteFile(
string path, CancellationToken cancellationToken);
204 Task
MoveFile(
string source,
string destination, CancellationToken cancellationToken);
213 Task
MoveDirectory(
string source,
string destination, CancellationToken cancellationToken);
230 Task<DateTimeOffset>
GetLastModified(
string path, CancellationToken cancellationToken);
Interface for using filesystems.
Task< IReadOnlyList< string > > GetFiles(string path, CancellationToken cancellationToken)
Returns full file names in a given path .
string GetFileName(string path)
Gets the file name portion of a path .
Task< bool > PathIsChildOf(string parentPath, string childPath, CancellationToken cancellationToken)
Check if a given parentPath is a parent of a given parentPath .
string ResolvePath()
Retrieve the full path of the current working directory.
FileStream CreateAsyncSequentialReadStream(string path)
Creates an asynchronous FileStream for sequential reading.
ValueTask< byte[]> ReadAllBytes(string path, CancellationToken cancellationToken)
Returns all the contents of a file at path as a byte array.
string ConcatPath(params string[] paths)
Combines an array of strings into a path.
Task MoveFile(string source, string destination, CancellationToken cancellationToken)
Moves a file at source to destination .
Task< IReadOnlyList< string > > GetDirectories(string path, CancellationToken cancellationToken)
Returns full directory names in a given path .
string GetDirectoryName(string path)
Gets the directory portion of a given path .
Task CreateDirectory(string path, CancellationToken cancellationToken)
Create a directory at path .
Task DeleteFile(string path, CancellationToken cancellationToken)
Deletes a file at path .
ValueTask CopyFile(string src, string dest, CancellationToken cancellationToken)
Copy a file from src to dest .
Task< DateTimeOffset > GetLastModified(string path, CancellationToken cancellationToken)
Get the DateTimeOffset of when a given path was last modified.
Task ZipToDirectory(string path, Stream zipFile, CancellationToken cancellationToken)
Extract a set of zipFile to a given path .
FileStream CreateAsyncSequentialWriteStream(string path)
Creates an asynchronous FileStream for sequential writing.
ValueTask WriteAllBytes(string path, byte[] contents, CancellationToken cancellationToken)
Writes some contents to a file at path overwriting previous content.
FileStream GetFileStream(string path, bool shareWrite)
Gets the Stream for a given file path .
string GetFileNameWithoutExtension(string path)
Gets the file name portion of a path with.
Task DeleteDirectory(string path, CancellationToken cancellationToken)
Recursively delete a directory, removes and does not enter any symlinks encounterd.
Task< bool > FileExists(string path, CancellationToken cancellationToken)
Check that the file at path exists.
Task< List< string > > GetFilesWithExtension(string path, string extension, bool recursive, CancellationToken cancellationToken)
Gets a list of files in path with the given extension .
Task MoveDirectory(string source, string destination, CancellationToken cancellationToken)
Moves a directory at source to destination .
ValueTask CopyDirectory(IEnumerable< string >? ignore, Func< string, string, ValueTask >? postCopyCallback, string src, string dest, int? taskThrottle, CancellationToken cancellationToken)
Copies a directory from src to dest .
Task< bool > DirectoryExists(string path, CancellationToken cancellationToken)
Check that the directory at path exists.
string ResolvePath(string path)
Retrieve the full path of some path given a relative path. Must be used before passing relative path...
bool PathContainsParentAccess(string path)
Check if a path contains the '..' parent directory accessor.