2using System.Collections.Generic;
4using System.IO.Abstractions;
6using System.Threading.Tasks;
73 Task<bool>
PathIsChildOf(
string parentPath,
string childPath, CancellationToken cancellationToken);
86 IEnumerable<string>? ignore,
87 Func<string, string, ValueTask>? postCopyCallback,
91 CancellationToken cancellationToken);
99 Task<bool>
FileExists(
string path, CancellationToken cancellationToken);
116 ValueTask<byte[]>
ReadAllBytes(
string path, CancellationToken cancellationToken);
124 Task<IReadOnlyList<string>>
GetDirectories(
string path, CancellationToken cancellationToken);
132 Task<IReadOnlyList<string>>
GetFiles(
string path, CancellationToken cancellationToken);
157 ValueTask
WriteAllBytes(
string path,
byte[] contents, CancellationToken cancellationToken);
166 ValueTask
CopyFile(
string src,
string dest, CancellationToken cancellationToken);
184 Task<List<string>>
GetFilesWithExtension(
string path,
string extension,
bool recursive, CancellationToken cancellationToken);
192 Task
DeleteFile(
string path, CancellationToken cancellationToken);
224 Task
MoveFile(
string source,
string destination, CancellationToken cancellationToken);
233 Task
MoveDirectory(
string source,
string destination, CancellationToken cancellationToken);
250 Task<DateTimeOffset>
GetLastModified(
string path, CancellationToken cancellationToken);
258 Task<IDirectoryInfo>
DirectoryInfo(
string path, CancellationToken cancellationToken);
Interface for using filesystems.
Stream CreateAsyncReadStream(string path, bool sequential, bool shareWrite)
Creates an asynchronous FileStream for sequential reading.
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.
Task< IDirectoryInfo > DirectoryInfo(string path, CancellationToken cancellationToken)
Gets a IDirectoryInfo for the given path .
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 .
bool IsPathRooted(string path)
Check if a given path is at the root level of the filesystem.
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 .
ValueTask WriteAllBytes(string path, byte[] contents, CancellationToken cancellationToken)
Writes some contents to a file at path overwriting previous content.
Stream CreateAsyncSequentialWriteStream(string path)
Creates an asynchronous FileStream for sequential writing.
string GetFileNameWithoutExtension(string path)
Gets the file name portion of a path with.
IIOManager CreateResolverForSubdirectory(string subdirectoryPath)
Create a new IIOManager that resolves paths to the specified subdirectoryPath .
char AltDirectorySeparatorChar
Gets the alternative directory separator character.
char DirectorySeparatorChar
Gets the primary directory separator character.
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.