Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

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.