INFO

This API documentation is for FAKE version 5.0 or later. The old API documentation can be found here for migration or here for fake 4

This is part of the Fake.IO.FileSystem module.

ChangeWatcher

This module is part of the Fake.IO.FileSystem package

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
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.
)
namespace System
type Console =
  static member BackgroundColor : ConsoleColor with get, set
  static member Beep : unit -> unit + 1 overload
  static member BufferHeight : int with get, set
  static member BufferWidth : int with get, set
  static member CapsLock : bool
  static member Clear : unit -> unit
  static member CursorLeft : int with get, set
  static member CursorSize : int with get, set
  static member CursorTop : int with get, set
  static member CursorVisible : bool with get, set
  ...
System.Console.ReadLine() : string
val ignore : value:'T -> unit

Nested types and modules

TypeDescription
Options

Functions and values

Function or valueDescription
run onChange fileIncludes
Signature: onChange:(seq<FileChange> -> unit) -> fileIncludes:IGlobbingPattern -> IDisposable
runWithOptions(...)
Signature: foptions:(Options -> Options) -> onChange:(seq<FileChange> -> unit) -> fileIncludes:IGlobbingPattern -> IDisposable

Watches for changes in the matching files. Returns an IDisposable which allows to dispose all internally used FileSystemWatchers.

Parameters

  • onChange - function to call when a change is detected.
  • fileIncludes - The glob pattern for files to watch for changes.