Class ReadDirectoryBase
Recursively iterates over all elements in a directory.
public abstract class ReadDirectoryBase : TaskBase, ITask
- Inheritance
-
objectMarshalByRefObjectReadDirectoryBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ReadDirectoryBase(string)
Recursively iterates over all elements in a directory.
protected ReadDirectoryBase(string path)
Parameters
path
stringThe path of the directory to read.
Fields
Source
The directory to read.
protected readonly DirectoryInfo Source
Field Value
- DirectoryInfo
Properties
FollowSymlinks
Controls whether to follow symlinks.
public bool FollowSymlinks { get; init; }
Property Value
- bool
UnitsByte
true
if UnitsProcessed and UnitsTotal are measured in bytes;
false
if they are measured in generic units.
protected override bool UnitsByte { get; }
Property Value
- bool
Methods
Execute()
The actual code to be executed.
protected override void Execute()
Remarks
State is automatically set to Started before calling this method, to Complete after a successful exit and to an appropriate error state in case on an exception. You can set additional TaskStates during execution.
Exceptions
- OperationCanceledException
The operation was canceled.
- IOException
The task ended with IOError.
- WebException
The task ended with WebError.
HandleDirectory(DirectoryInfo)
Called once for every sub-directory below Source.
protected abstract void HandleDirectory(DirectoryInfo directory)
Parameters
directory
DirectoryInfoThe directory to handle.
HandleFile(FileInfo, FileInfo?)
Called once for every file below Source.
protected abstract void HandleFile(FileInfo file, FileInfo? hardlinkTarget = null)
Parameters
file
FileInfoThe file to handle.
hardlinkTarget
FileInfoA previously handled file that is hardlinked to
file
. May benull
.