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

OBSOLETE

Open Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem, module: ChangeWatcher)

ChangeWatcher

This module contains helpers to react to file system events.

Nested types and modules

TypeDescription
FileChange
OBSOLETE

Open Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem, type: FileChange)

FileStatus
OBSOLETE

Open Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem, type: FileStatus)

WatchChangesOption
OBSOLETE

Open Fake.IO instead (FAKE0001 - package: Fake.IO.FileSystem, type: ChangeWatcher.Options)

Functions and values

Function or valueDescription
calcDirsToWatch(fileIncludes)
Signature: fileIncludes:FileIncludes -> string list
handleWatcherEvents status onChange e
Signature: status:FileStatus -> onChange:(FileChange -> unit) -> e:FileSystemEventArgs -> unit
WatchChanges
Signature: (seq<FileChange> -> unit) -> FileIncludes -> IDisposable
Attributes:
[<Obsolete("Open Fake.IO and use ChangeWatcher.run instead (FAKE0001 - package: Fake.IO.FileSystem, module Fake.IO.ChangeWatcher, function: run)")>]
OBSOLETE

Open Fake.IO and use ChangeWatcher.run instead (FAKE0001 - package: Fake.IO.FileSystem, module Fake.IO.ChangeWatcher, function: run)

WatchChangesWithOptions(...)
Signature: options:WatchChangesOption -> onChange:(seq<FileChange> -> unit) -> fileIncludes:FileIncludes -> IDisposable
Attributes:
[<Obsolete("Open Fake.IO and use ChangeWatcher.runWithOptions instead (FAKE0001 - package: Fake.IO.FileSystem, module Fake.IO.ChangeWatcher, function: runWithOptions)")>]
OBSOLETE

Open Fake.IO and use ChangeWatcher.runWithOptions instead (FAKE0001 - package: Fake.IO.FileSystem, module Fake.IO.ChangeWatcher, function: runWithOptions)

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

Parameters

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

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
Target "Watch" (fun _ ->
    use watcher = !! "c:/projects/watchDir/*.txt" |> WatchChanges (fun changes ->
        // do something
    )

    System.Console.ReadLine() |> ignore

    watcher.Dispose() // if you need to cleanup the watches.
)
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