FAKE - F# Make - A DSL for build tasks and more FAKE
6.0.0

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

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

Options

The ChangeWatcher options

Functions and values

Function or value Description

run onChange fileIncludes

Full Usage: run onChange fileIncludes

Parameters:
    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 with the default options Returns an IDisposable which allows to dispose all internally used FileSystemWatchers.

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

runWithOptions fOptions onChange fileIncludes

Full Usage: runWithOptions fOptions onChange fileIncludes

Parameters:
    fOptions : 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.

fOptions : 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