-
Notifications
You must be signed in to change notification settings - Fork 4
FileSystems
FileSystems provides abstraction of file system. Whole module is based on Models.Features, so contracts are separated into small features and implementations can implement only supported one. All features are places in namespace Neptuo.FileSystems.Features. There are features for
- Enumerating and searching for directories and files.
- Creating, reading and modifying files and directories.
Wrapper around System.IO file system is placed in project Neptuo.FileSystems.Local. From version 1.0.1 there are also extension methods for simple calling feature contracts.
For reading structure of file system there are feature interfaces IDirectoryEnumerator, for enumerating directories, and IFileEnumerator, for enumerating files, that are contained in current folder.
For advanced file and directory searching there are feature instances in namespace Neptuo.FileSystems.Features.Searching. These contracts enables searching directly in content of directory or in the whole file system sub-tree.
Working with file content is splitted into three interface features:
-
IFileContentReaderis for reading content of file. -
IFileContentAppenderis for appending content at the end of already existing content. -
IFileContentUpdateris for overriding file content.
All these contracts are asynchronous with extension methods that run synchronously.
For creating file there is IFileCreator which is typically implemented by directory implementation. This file creator creates files in concrete directory. Same design is used for creating directories by IDirectoryCreator.
For deleting files and directories there is IFileDeleter and IDirectoryDeleter which deletes current file or directory.
In namespace Neptuo.FileSystems.Events are defined event objects (compatible with Events) for subscription of notifications about changes in file system.
Local (using FileSystemWatcher) dispatcher of these events is implemented in package Neptuo.FileSystems.Events.Local, but currently the only supported events are those for file changes. Directory change events are not supported by now.