SmartDirWatcher 1.0.1

There is a newer version of this package available.
See the version list below for details.
Install-Package SmartDirWatcher -Version 1.0.1
dotnet add package SmartDirWatcher --version 1.0.1
<PackageReference Include="SmartDirWatcher" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SmartDirWatcher --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SmartDirWatcher, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SmartDirWatcher as a Cake Addin
#addin nuget:?package=SmartDirWatcher&version=1.0.1

// Install SmartDirWatcher as a Cake Tool
#tool nuget:?package=SmartDirWatcher&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


An alternative to the native .NET FileSystemWatcher which always causes several problems to many users. This library is based on implementation of W32 API to get system internal file indices. Then an internal object can identify if a file is newly created, changed or deleted.

Implement the SmartDirWatcher

After loading the nuget package the implementation is quite simple. Just instance an object, connect the eventhandler and start the watcher. You can define watching for a specific file extension or for an explicit filename.

Watch for a extension

Watcher smartWatcher = new Watcher("directory/to/watch/for/files", ".dll", WATCHMODE.Extension);
smartWatcher.DirWatcherEventRaised += OnFolderFilesChanged;

Watch for a specific filename

Watcher smartWatcher = new Watcher("directory/to/watch/for/files", "awesome.txt", WATCHMODE.FileName);
smartWatcher.DirWatcherEventRaised += OnFolderFilesChanged;

How to handle events.

After an instance of SmartDirWatcher is up and running, everytime something happens within the folder you watching, an event will been fired throug the event handler. Be sure to cast EventArgs to DirWatcherEventArgs to handle the fired event type. You can then select the event you want to interact with and do whatever you want to.

 protected void OnFolderFilesChanged(object sender, EventArgs e)
            DirWatcherEventArgs args = e as DirWatcherEventArgs;
            switch (args.Type)
                case EventType.Created:
                    // Do something
                case EventType.Changed:
                    // Do something
                case EventType.Deleted:
                     // Do something

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 574 1/8/2019
1.0.1 449 10/12/2018

Initial Release of SmwartDirWatcher.