Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/watcher/lib/src/directory_watcher/linux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ class _LinuxDirectoryWatcher

/// Emits [ChangeType.ADD] events for the recursive contents of [path].
void _addSubdir(String path) {
_listen(Directory(path).list(recursive: true), (FileSystemEntity entity) {
_listen(Directory(path).list(recursive: true, followLinks: false),
(FileSystemEntity entity) {
if (entity is Directory) {
_watchSubdir(entity.path);
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/watcher/lib/src/directory_watcher/mac_os.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class _MacOSDirectoryWatcher
if (_files.containsDir(path)) continue;

var stream = Directory(path)
.list(recursive: true)
.list(recursive: true, followLinks: false)
.ignoring<PathNotFoundException>();
var subscription = stream.listen((entity) {
if (entity is Directory) return;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/watcher/lib/src/directory_watcher/windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class _WindowsDirectoryWatcher
// itself, so there are no other types of "path not found" that
// might need different handling here.
var stream = Directory(path)
.list(recursive: true)
.list(recursive: true, followLinks: false)
.ignoring<PathNotFoundException>();
var subscription = stream.listen((entity) {
if (entity is Directory) return;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/watcher/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension DirectoryRobustRecursiveListing on Directory {
///
/// Theses can arise from concurrent file-system modification.
Stream<FileSystemEntity> listRecursivelyIgnoringErrors() {
return list(recursive: true)
return list(recursive: true, followLinks: false)
.ignoring<PathNotFoundException>()
.ignoring<PathAccessException>();
}
Expand Down
Loading