Skip to content

Modern Fs FileWatcher Stop

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Filesystem › Filesystem Library › FileWatcher.Stop

FileWatcher.Stop

Stops watching; harmless when not watching.

Syntax

FileWatcher.Stop( )

Examples

#import "std/fs"
using fs

dim td as FsResultUStr = CreateTempDir( "fbdoc" )
dim as ustring dir_ = td.Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
WriteAllText( p, "hello" )

dim w as FileWatcher
w.Start( dir_ )

w.Stop( )
print w.IsWatching( )        '' false

'' Stopping twice is harmless, and the destructor stops -- so a watcher
'' cannot leak its handle
w.Stop( )

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Locking, Mapping And Watching

Clone this wiki locally