watcher
A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified.
1.2.1
12M downloads/mo
#11 most downloaded on pub.dev
dart-lang/tools
What this package is like to depend on
Last release 7 months ago
08 Jan 2026
Release timing varies
gaps range from 3 weeks to 1.6 years
Some releases are documented
notes for 27 of 68 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
70 releases · first in 2013
3 releases in the last 12 months
see the full history below
Release timeline
70 releases · Jul 2013 to Jan 2026Releases
latest 60 of 70-
1.2.108 Jan 2026Release notes
Open source →- Bug fix: versions before 1.2.0 would allow and ignore a trailing path
separator passed to
DirectoryWatcherorFileWatcherconstructors, restore that behavior. - In paths passed to
DirectoryWatcherorFileWatcherconstructors, remove multiple adjacent separators and.and.., so they will not be returned in events. - Bug fix: on Mac, stop issuing
assert(false)when amodifyDirectoryevent is ignored, so the unused events are silently ignored instead of throwing in debug builds.
- Bug fix: versions before 1.2.0 would allow and ignore a trailing path
separator passed to
-
1.2.012 Dec 2025Release notes
Open source →- Polling watchers now check file sizes as well as "last modified" times, so they are less likely to miss changes on platforms with low resolution timestamps.
DirectoryWatcheron Windows performance: reduce 100ms buffering of events before reporting to 5ms, the larger buffer isn't needed for correctness after the various fixes.DirectoryWatcheron Windows watches in a separate Isolate to make buffer exhaustion, "Directory watcher closed unexpectedly", much less likely. The old implementation which does not use a separate Isolate is available asDirectoryWatcher(path, runInIsolateOnWindows: false).DirectoryWatcheron Windows: if buffer exhaustion does happen, emit a "modify" event for all know files instead of an exception.- Document behavior on Linux if the system watcher limit is hit.
- Require Dart SDK
^3.4.0. - Bug fix: native
DirectoryWatcherimplementations now consistently handle links as files, instead of sometimes reading through them and sometimes reporting them as files. The pollingDirectoryWatcherstill reads through links. - Bug fix: with the polling
DirectoryWatcher, fix spurious modify event emitted because of a file delete during polling. - Bug fix: due to the link handling change, native
DirectoryWatcheron Linux and MacOS is no longer affected by a severe performance regression if there are symlink loops in the watched directory. The pollingDirectoryWatcheris fixed to skip already-visited directories to prevent the performance issue while still reading through links. - Bug fix: with
DirectoryWatcheron Windows, the last of a rapid sequence of modifications in a newly-created directory was sometimes dropped. Make it reliably report the last modification. - Bug fix: with
DirectoryWatcheron Windows, a move over an existing file was reported incorrectly. For example, ifaandbalready exist, thenais moved ontob, it would be reported as three events: deletea, deleteb, createb. Now it's reported as two events: deletea, modifyb. This matches the behavior of the Linux and MacOS watchers. - Bug fix: with
DirectoryWatcheron Windows, new links to directories were sometimes incorrectly handled as actual directories. Now they are reported as files, matching the behavior of the Linux and MacOS watchers. - Bug fix: unify
DirectoryWatcherimplementation on Windows with the MacOS implementation, addressing various race conditions around directory renames. - Bug fix: new
DirectoryWatcherimplementation on Linux that fixes various issues: tracking failure following subdirectory move, incorrect events when there are changes in a recently-moved subdirectory, incorrect events due to various situations involving subdirectory moves. - Bug fix: new
DirectoryWatcherimplementation on MacOS that fixes various issues including duplicate events for changes in new directories, incorrect events when close together directory renames have overlapping names. - Bug fix: with
FileWatcheron MacOS, a modify event was sometimes reported if the file was created immediately before the watcher was created. Now, if the file exists when the watcher is created then this modify event is not sent. This matches the Linux native and polling (Windows) watchers.
-
1.1.402 Oct 2025Release notes
Open source →- Improve handling of subdirectories: ignore
PathNotFoundExceptiondue to subdirectory deletion racing with watcher internals, instead of raising it on the event stream. - Improve handling of watcher overflow on Windows: prepare for future versions
of SDK, which will properly forward
FileSystemExceptioninto the stream returned by the watcher.
- Improve handling of subdirectories: ignore
-
1.1.325 Aug 2025Release notes
Open source →- Improve handling of
FileSystemException: Directory watcher closed unexpectedlyon Windows. The watcher was already attempting to restart after this error and resume sending events. But, the restart would sometimes silently fail. Now, it is more reliable. - Improving handling of directories that are created then immediately deleted on
Windows. Previously, that could cause a
PathNotFoundExceptionto be thrown.
- Improve handling of
-
1.1.211 Jun 2025Release notes
Open source →- Fix a bug on Windows where a file creation event could be reported twice when creating a file recursively in a non-existent directory.
-
1.1.117 Dec 2024Release notes
Open source →- Ensure
PollingFileWatcher.readycompletes for files that do not exist. - Require Dart SDK
^3.1.0 - Move to
dart-lang/toolsmonorepo.
- Ensure
-
1.1.012 May 2023Release notes
Open source →- Require Dart SDK >= 3.0.0
- Remove usage of redundant ConstructableFileSystemEvent classes.
-
1.0.214 Oct 2022Release notes
Open source →- Require Dart SDK >= 2.14
- Ensure
DirectoryWatcher.readycompletes even when errors occur that close the watcher. - Add markdown badges to the readme.
-
1.0.130 Sep 2021 -
1.0.005 Feb 2021Release notes
Open source →- Require Dart SDK >= 2.12
- Add the ability to create custom Watcher types for specific file paths.
-
1.0.0-nullsafety.013 Jan 2021 pre-releaseNothing published for this version
-
0.9.716 Jul 2015Release notes
Open source →- Fix a bug in
FileWatcherwhere events could be added after watchers were closed.
- Fix a bug in
-
0.9.7+203 May 2016Release notes
Open source →- Narrow the constraint on
asyncto reflect the APIs this package is actually using.
- Narrow the constraint on
-
0.9.7+310 Aug 2016 -
0.9.7+421 Sep 2017 -
0.9.7+605 Jan 2018 -
0.9.7+701 Feb 2018Release notes
Open source →-
Updates to support Dart 2.0 core library changes (wave 2.2). See issue 31847 for details.
-
-
0.9.7+823 May 2018 -
0.9.7+925 Jun 2018 -
0.9.7+1018 Jul 2018 -
0.9.7+1212 Jul 2019Release notes
Open source →- Catch
FileSystemExceptionduringexistsSync()on Windows. - Internal cleanup.
- Catch
-
0.9.7+1321 Nov 2019Release notes
Open source →- Catch & forward
FileSystemExceptionfrom unexpectedly closed file watchers on windows; the watcher will also be automatically restarted when this occurs.
- Catch & forward
-
0.9.7+1406 Mar 2020Release notes
Open source →- Prepare for breaking change in SDK where modified times for not found files becomes meaningless instead of null.
-
0.9.7+1522 Apr 2020Release notes
Open source →- Fix a bug on Mac where modifying a directory with a path exactly matching a prefix of a modified file would suppress change events for that file.
-
0.9.612 Jun 2015Release notes
Open source →-
Add a
Watcherinterface that encompasses watching both files and directories. -
Add
FileWatcherandPollingFileWatcherclasses for watching changes to individual files. -
Deprecate
DirectoryWatcher.directory. UseDirectoryWatcher.pathinstead.
-
-
0.9.510 Mar 2015 -
0.9.422 Jan 2015Release notes
Open source →- Treat add events for known files as modifications instead of discarding them on Mac OS.
-
0.9.304 Aug 2014Release notes
Open source →-
Improved support for Windows via
WindowsDirectoryWatcher. -
Simplified
PollingDirectoryWatcher. -
Fixed bugs in
MacOSDirectoryWatcher
-
-
0.9.3-dev04 Aug 2014 pre-releaseNothing published for this version
-
0.9.210 Dec 2013Nothing published for this version
-
0.9.109 Dec 2013Nothing published for this version
-
0.9.006 Nov 2013Nothing published for this version
-
0.8.1001 Nov 2013Nothing published for this version
-
0.8.10+304 Nov 2013Nothing published for this version
-
0.8.10+405 Nov 2013Nothing published for this version
-
0.8.931 Oct 2013Nothing published for this version
-
0.8.830 Oct 2013Nothing published for this version
-
0.8.728 Oct 2013Nothing published for this version
-
0.8.624 Oct 2013Nothing published for this version
-
0.8.521 Oct 2013Nothing published for this version
-
0.8.419 Oct 2013Nothing published for this version
-
0.8.317 Oct 2013Nothing published for this version
-
0.8.214 Oct 2013Nothing published for this version
-
0.8.104 Oct 2013Nothing published for this version
-
0.8.003 Oct 2013Nothing published for this version
-
0.7.627 Sep 2013Nothing published for this version
-
0.7.6+401 Oct 2013Nothing published for this version
-
0.7.521 Sep 2013Nothing published for this version
-
0.7.418 Sep 2013Nothing published for this version
-
0.7.3+116 Sep 2013Nothing published for this version
-
0.7.206 Sep 2013Nothing published for this version
-
0.7.2+108 Sep 2013Nothing published for this version
-
0.7.103 Sep 2013Nothing published for this version
-
0.7.028 Aug 2013Nothing published for this version
-
0.6.21+326 Aug 2013Nothing published for this version
-
0.6.20+122 Aug 2013Nothing published for this version
-
0.6.1919 Aug 2013Nothing published for this version
-
0.6.1710 Aug 2013Nothing published for this version
-
0.6.17+212 Aug 2013Nothing published for this version
-
0.6.15+205 Aug 2013Nothing published for this version