PathWatcher

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

ShotInstancenot creatablecomingFiles

Up and coming

Know when a file or folder appears, disappears or changes in a folder you watch.

PathHandler:WatchAsync(options) gives one, a child of that PathHandler. It returns after its first look, so what is already there is known and doesn't fire. Then it looks again every Interval seconds, and a Pattern can limit it to matching names.

Properties

NameTypeDefaultDescription
Pathstring
Recursiveboolean
Patternstring?A Luau string pattern each name must match, such as "%.log$".
IntervalnumberSeconds between looks at the folder; 1 by default.

Methods

NameArgumentsReturnsDescription
GetEntries(){ PathHandler }Every file and folder that is there now.
Stop()()

Events

NamePassesDescription
EntryAdded(PathHandler)Fires with the PathHandler of each file or folder that appears after the first look.
EntryRemoved(string)Fires with the path of a file or folder that went.
EntryChanged(PathHandler)Fires with the PathHandler of an entry whose modified time moved.
From ShotInstance 33