This repository was archived by the owner on Feb 10, 2025. It is now read-only.
Commit 7168052 1 parent 5022c65 commit 7168052 Copy full SHA for 7168052
File tree 3 files changed +16
-5
lines changed
lib/src/directory_watcher
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change
1
+ # 0.9.7+12
2
+
3
+ * Catch ` FileSystemException ` during ` existsSync() ` on Windows.
4
+
1
5
# 0.9.7+11
2
6
3
7
* Fix an analysis hint.
Original file line number Diff line number Diff line change @@ -308,8 +308,8 @@ class _WindowsDirectoryWatcher
308
308
}
309
309
}
310
310
311
- /// Returns one or more events that describe the change between the last known
312
- /// state of [path] and its current state on the filesystem.
311
+ /// Returns zero or more events that describe the change between the last
312
+ /// known state of [path] and its current state on the filesystem.
313
313
///
314
314
/// This returns a list whose order should be reflected in the events emitted
315
315
/// to the user, unlike the batched events from [Directory.watch] . The
@@ -318,8 +318,15 @@ class _WindowsDirectoryWatcher
318
318
List <FileSystemEvent > _eventsBasedOnFileSystem (String path) {
319
319
var fileExisted = _files.contains (path);
320
320
var dirExisted = _files.containsDir (path);
321
- var fileExists = File (path).existsSync ();
322
- var dirExists = Directory (path).existsSync ();
321
+
322
+ bool fileExists;
323
+ bool dirExists;
324
+ try {
325
+ fileExists = File (path).existsSync ();
326
+ dirExists = Directory (path).existsSync ();
327
+ } on FileSystemException {
328
+ return const < FileSystemEvent > [];
329
+ }
323
330
324
331
var events = < FileSystemEvent > [];
325
332
if (fileExisted) {
Original file line number Diff line number Diff line change 1
1
name : watcher
2
- version : 0.9.7+11
2
+ version : 0.9.7+12
3
3
4
4
description : >
5
5
A file system watcher. It monitors changes to contents of directories and
You can’t perform that action at this time.
0 commit comments