Skip to content

Modern Fs FsChange Path

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

Home › Filesystem › Filesystem Library › FsChange.Path

FsChange.Path

Returns the full path of the entry that changed.

Syntax

FsChange.Path( )

Notes

  • the FULL path, not a bare leaf

Examples

#import "std/containers"
#import "std/fs"
using fs, containers

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_ )
WriteAllText( PathJoin( dir_, "new.txt" ), "x" )

dim changes as Array( of FsChange )
w.Poll( changes, 500 )

for i as int32 = 0 to changes.Count - 1
    '' THE FULL PATH, not a bare leaf -- so it can be opened without
    '' joining it to the watched directory first
    print PathStartsWith( changes[ i ].Path( ), dir_ )    '' true
next
print "polled"

w.Stop( )

RemoveDirAll( dir_ )

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

Clone this wiki locally