Index: pkg/glob/lib/src/list_tree.dart |
diff --git a/pkg/glob/lib/src/list_tree.dart b/pkg/glob/lib/src/list_tree.dart |
index bf6f7a4a73d023c3aa45064f9b22b34336a00e0d..3667d63c1abbd2a1a9492af9601203717604f736 100644 |
--- a/pkg/glob/lib/src/list_tree.dart |
+++ b/pkg/glob/lib/src/list_tree.dart |
@@ -13,11 +13,13 @@ import 'ast.dart'; |
import 'stream_pool.dart'; |
import 'utils.dart'; |
-/// The errno for a file or directory not existing. |
-/// |
-/// This is consistent across platforms. |
+/// The errno for a file or directory not existing on Mac and Linux. |
const _ENOENT = 2; |
+/// Another errno we see on Windows when trying to list a non-existent |
+/// directory. |
+const _ENOENT_WIN = 3; |
+ |
/// A structure built from a glob that efficiently lists filesystem entities |
/// that match that glob. |
/// |
@@ -331,7 +333,8 @@ class _ListTreeNode { |
// glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but |
// succeed if "foo/bar/qux/baz" doesn't exist. |
return error is FileSystemException && |
- error.osError.errorCode == _ENOENT; |
+ (error.osError.errorCode == _ENOENT || |
+ error.osError.errorCode == _ENOENT_WIN); |
}); |
resultPool.add(stream); |
}); |
@@ -382,7 +385,8 @@ class _ListTreeNode { |
// that we only ignore warnings below wild cards. For example, the |
// glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but |
// succeed if "foo/bar/qux/baz" doesn't exist. |
- if (error.osError.errorCode == _ENOENT) { |
+ if (error.osError.errorCode == _ENOENT || |
+ error.osError.errorCode == _ENOENT_WIN) { |
return const []; |
} else { |
rethrow; |