# GH_FileWatcher class

Namespace: [Grasshopper.Kernel](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.kernel.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_FileWatcher : IDisposable
```

Provides easy mechanisms to monitor changes to the local File System.

## Properties

- [Active](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/active.md): Gets or sets the active flag on this watcher.
- [Buffer](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/buffer.md): Gets or sets the time during which events are buffered. If multiple events for the same file occur within the buffered timespan, they will be merged into one event.
- [InvokeOnDefaultThread](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/invokeondefaultthread.md): Gets or sets invoke behaviour for events. If true, then the event delegate is called via the Grasshopper main UI thread. This is almost always what you need.
- [IsDisposed](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/isdisposed.md)
- [Path](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/path.md): Gets the file or folder path currently being watched.

## Methods

- [CreateDirectoryWatcher](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/createdirectorywatcher.md): (2 overloads, static) Create a new FileSystem Watcher object aimed at a specific file.
- [CreateFileWatcher](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/createfilewatcher.md): (2 overloads, static) Create a new FileSystem Watcher object aimed at a specific file.
- [Dispose](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/dispose.md): (2 overloads)
- [SetCustomUIThread](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-filewatcher/setcustomuithread.md): (2 overloads) If you want to override the default Invoke behaviour, you must set InvokeOnDefaultThread to False and supply either a custom Control or a Form.
