-
Notifications
You must be signed in to change notification settings - Fork 1
FileList
FileList
is a special class that encapsulates
- a list of files (
IFile
objects); - a base directory the files was read from.
The main purposes of this class are
- to provide handy way of performing recursive operations with file tree;
- to support file selection (include/exclude).
You would probably get a FileList
from a directory. And there are two ways to do that, it is important to understand the difference between them. First way is to use Files
property of the directory:
IDirectory src = "C:/Projects/MyProject/Src";
FileList files = src.Files; // files contain only direct Src children
In this case the files
will contain only direct children files from Src directory not from sub-directories. It means that operations like CopyTo
will not work recursively because the initial FileList
does not contain recursive children.
The second way is using SearchFilesRecursively()
extension method. This metod will fetch direct children and all files from all sub-directories:
IDirectory src = "C:/Projects/MyProject/Src";
FileList files = src.SearchFilesRecursively();
// files contain all children files including subdirectories
FileList
has a number of method to include or exclude files from the list:
IDirectory src = "C:/Projects/MyProject/Src";
FileList allBinaries = src
.SearchFilesRecursively()
.IncludeByExtension("dll");
Removes all files
Copies all files to directory as a flat list
Copies all files to provided directory preserving all subdirectories from relative path.
Writing Tasks
- Creating a Workflow
- Defining Tasks
- Share State accross Tasks
- Mastering Dependencies
- Using result transformers
- Using Subflows to organize tasks
- Tasks Preconditions
- Recovering failure results
- Declaring dynamic tasks
- Creating Custom Tasks
Running Tasks
API
Tasklib