Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

FileSystemWatcher

class FileSystemWatcher

Module: System.IO
Assembly: System.Runtime.dll
Source file: FileSystemWatcher.rvn

Inheritance: Object → FileSystemWatcher
Implements: Disposable

Watches a physical directory using the OS provider. Access and callbacks are owner-queue serialized. Dispose explicitly to stop the timer and release the native subscription. No finalizer is supplied.

Constructors

1 item
FileSystemWatcher(path: string, filter?: string) Creates a stopped watcher with a filename filter supporting * and ?; omitted filter matches all names.

Properties

4 items
EnableRaisingEvents: bool Starts or stops notifications. Start failures panic; TryStart preserves typed errors.
Filter: string Basename pattern (* and ?), compared ordinally; Windows ignores case. Empty means *.
IncludeSubdirectories: bool Whether descendants are watched. Defaults to false; change while stopped.
Path: string Physical directory path. Change settings while stopped; relative paths resolve at Start.

Methods

8 items
Dispose() -> () Stops permanently, releasing subscriptions and handlers. Idempotent. Implements Disposable.Dispose
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Stop() -> () Stops delivery and releases the native subscription. Pending notifications are discarded.
Subscribe(callback: (FileSystemNotification) -> ()) -> Disposable Subscribes to all notifications. Dispose the registration to release its callback. The union case determines the payload; rescan notifications never fabricate a change.
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString
TryStart() -> Result<void, FileSystemWatcherError> Starts watching before returning. Repeated starts are harmless; disposal returns Closed. Notifications run on the invocation completion queue, at most 64 per 50 ms timer tick.