ChangeWatcher Module
This module contains helpers to react to file system events.
Example
Target.create "Watch" (fun _ ->
use watcher = !! "c:/projects/watchDir/*.txt" |> ChangeWatcher.run (fun changes ->
// do something
)
System.Console.ReadLine() |> ignore
watcher.Dispose() // if you need to cleanup the watcher.
)
Types
Type | Description |
Functions and values
Function or value | Description |
Full Usage:
run onChange fileIncludes
Parameters:
seq<FileChange> -> unit
-
Function to call when a change is detected.
fileIncludes : IGlobbingPattern
-
The glob pattern for files to watch for changes.
Returns: IDisposable
|
Watches for changes in the matching files with the default options Returns an IDisposable which allows to dispose all internally used FileSystemWatchers.
|
Full Usage:
runWithOptions fOptions onChange fileIncludes
Parameters:
Options -> Options
-
ChangeWatcher options
onChange : seq<FileChange> -> unit
-
Function to call when a change is detected.
fileIncludes : IGlobbingPattern
-
The glob pattern for files to watch for changes.
Returns: IDisposable
|
Watches for changes in the matching files. Returns an IDisposable which allows to dispose all internally used FileSystemWatchers.
|