PathWatcher
Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.
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
| Name | Type | Default | Description |
|---|---|---|---|
| Path | string | ||
| Recursive | boolean | ||
| Pattern | string? | A Luau string pattern each name must match, such as "%.log$". | |
| Interval | number | Seconds between looks at the folder; 1 by default. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| GetEntries | () | { PathHandler } | Every file and folder that is there now. |
| Stop | () | () |
Events
| Name | Passes | Description |
|---|---|---|
| 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
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
