> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksfilewatcher.md).

# Class ksFileWatcher

Namespace: [KS.Unity.Editor](/reactor/api-reference/ks.unity.editor.md)\
Assembly: KSUnity-Editor.dll

Convenience wrapper of FileSystemWatcher.

```csharp
public class ksFileWatcher
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksFileWatcher](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksfilewatcher.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksFileWatcher(FileSystemEventHandler, string, params string\[]) <a href="#ks_unity_editor_ksfilewatcher__ctor_system_io_filesystemeventhandler_system_string_system_string" id="ks_unity_editor_ksfilewatcher__ctor_system_io_filesystemeventhandler_system_string_system_string"></a>

Constructor

```csharp
public ksFileWatcher(FileSystemEventHandler handler, string fileTypeFilter, params string[] paths)
```

#### Parameters

`handler` [FileSystemEventHandler](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventhandler)

handler for file system events.

`fileTypeFilter` [string](https://learn.microsoft.com/dotnet/api/system.string)

May include multiple filters seperated with |.

`paths` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

paths to watch.

### ksFileWatcher(FileSystemEventHandler, string, Flags, params string\[]) <a href="#ks_unity_editor_ksfilewatcher__ctor_system_io_filesystemeventhandler_system_string_ks_unity_editor_k" id="ks_unity_editor_ksfilewatcher__ctor_system_io_filesystemeventhandler_system_string_ks_unity_editor_k"></a>

Constructor

```csharp
public ksFileWatcher(FileSystemEventHandler handler, string fileTypeFilter, ksFileWatcher.Flags flags, params string[] paths)
```

#### Parameters

`handler` [FileSystemEventHandler](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventhandler)

handler for file system events.

`fileTypeFilter` [string](https://learn.microsoft.com/dotnet/api/system.string)

May include multiple filters seperated with |.

`flags` [ksFileWatcher](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksfilewatcher.md).[Flags](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksfilewatcher/ks.unity.editor.ksfilewatcher.flags.md)

`paths` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

paths to watch.

## Methods

### Start() <a href="#ks_unity_editor_ksfilewatcher_start" id="ks_unity_editor_ksfilewatcher_start"></a>

Starts watching directories for file system events.

```csharp
public void Start()
```

### Stop() <a href="#ks_unity_editor_ksfilewatcher_stop" id="ks_unity_editor_ksfilewatcher_stop"></a>

Stops watching directories for file system events.

```csharp
public void Stop()
```
