Lexical.FileSystem by Toni Kalajainen

<PackageReference Include="Lexical.FileSystem" Version="0.10.0" />

 FileProviderSystem

File system that reads, observes and browses files from IFileProvider source.
public class Watcher : IDisposable

File watcher.

protected IFileProvider fileProvider

Source file provider. This value is nulled on dispose.

protected string SubPath

Optional subpath within the source fileProvider.

public virtual bool CanBrowse { get; protected set; }

public virtual bool CanCreateFile { get; }

public virtual bool CanObserve { get; protected set; }

public virtual bool CanOpen { get; protected set; }

public virtual bool CanRead { get; protected set; }

public virtual bool CanTestExists { get; protected set; }

public virtual bool CanWrite { get; }

public IFileProvider FileProvider { get; }

Source file provider. This value is nulled on dispose.

public FileProviderSystem(IFileProvider fileProvider, string subpath = null, bool canBrowse = true, bool canObserve = true, bool canOpen = true)

Create file provider based file system.

public FileProviderSystem AddDisposable(object disposable)

Add disposable to list of objects to be disposed along with the system.

public FileSystemEntry[] Browse(string path)

Browse a directory for file and subdirectory entries.

public bool Exists(string path)

Tests whether a file or directory exists.

public IDisposable Observe(string path, IObserver<FileSystemEntryEvent> observer)

Attach an observer on to a single file or directory. Observing a directory will observe the whole subtree.

public Stream Open(string path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)

Open a file for reading.

public FileProviderSystem RemoveDisposable(object disposable)

Remove disposable from dispose list.