anchor.diff:        Stream<FileSystemEntity> files =
             directory.list(recursive: recursive, followLinks: false);
         await for (FileSystemEntity file in files) {
  -        if (file is! File) {
  +        if (file is Link) {
  +          final String linkPath = file.resolveSymbolicLinksSync();
  +          final FileSystemEntityType linkType =
  +              FileStat.statSync(linkPath).type;
  +          if (linkType == FileSystemEntityType.DIRECTORY) {
  +            // Skip links to directories.
  +            continue;
  +          }
  +        }
  +        if (file is Directory) {
             // Skip non-files.
             continue;
           }
  +        assert((file is Link) || (file is File));
           if (ignoreDotFiles && path.basename(file.path).startsWith('.')) {
             // Skip dot files.
             continue;
  
positive.code:     logger.flush();
    }
  
    void _scanFile(String devicePath, File file) {
      DevFSEntry entry = _entries[devicePath];
      if (entry == null) {
        // New file.
  
negative.code:     if (_isSourceEntry)
        return;
      _fileStat = file.statSync();
      if (_fileStat.type == FileSystemEntityType.LINK) {
        // Stat the link target.
        String resolved = file.resolveSymbolicLinksSync();
        _fileStat = FileStat.statSync(resolved);
      }
    }
  
    bool get _isSourceEntry => file == null;
  
    bool get _isAssetEntry => bundleEntry != null;
  
    File _getFile() {
      if (file is Link) {
        // The link target.
        return new File(file.resolveSymbolicLinksSync());
      }
      return file;
    }
  
    Future<List<int>> contentsAsBytes() async {
      if (_isSourceEntry)
        return bundleEntry.contentsAsBytes();
      final File file = _getFile();
      return file.readAsBytes();
    }
  
  