This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

IFileWatcher Pennington.Infrastructure

Watches file system paths for changes and notifies subscribers.

Methods

AddPathWatch

#
public void AddPathWatch(string path, string filePattern, Action<string, WatcherChangeTypes> onFileChanged, bool includeSubdirectories = true)

Watch a path for file changes matching a pattern.

Parameters

path string
filePattern string
onFileChanged Action<string, WatcherChangeTypes>
includeSubdirectories bool

SubscribeToChanges

#
public void SubscribeToChanges(Action onUpdate)

Subscribe to be notified when any watched file changes.

Parameters

onUpdate Action

SubscribeToChanges

#
public void SubscribeToChanges(Action<FileChangeNotification> onUpdate)

Subscribe to be notified when any watched file changes, with the changed path and change type.

Parameters

onUpdate Action<FileChangeNotification>

Pennington.Infrastructure.IFileWatcher

namespace Pennington.Infrastructure;

/// Watches file system paths for changes and notifies subscribers.
public interface IFileWatcher
{
    /// Watch a path for file changes matching a pattern.
    
public void AddPathWatch(string path, string filePattern, Action<string, WatcherChangeTypes> onFileChanged, bool includeSubdirectories = true)
; /// Subscribe to be notified when any watched file changes.
public void SubscribeToChanges(Action onUpdate)
; /// Subscribe to be notified when any watched file changes, with the changed path and change type.
public void SubscribeToChanges(Action<FileChangeNotification> onUpdate)
; }