list method

Stream<FileSystemEntity> list (
  1. {String root,
  2. bool followLinks: true}
)

Lists all FileSystemEntitys beneath root that match the glob.

This works much like Directory.list, but it only lists directories that could contain entities that match the glob. It provides no guarantees about the order of the returned entities, although it does guarantee that only one entity with a given path will be returned.

root defaults to the current working directory.

followLinks works the same as for Directory.list.

Implementation

Stream<FileSystemEntity> list({String root, bool followLinks = true}) {
  if (context.style != p.style) {
    throw StateError("Can't list glob \"$this\"; it matches "
        "${context.style} paths, but this platform uses ${p.style} paths.");
  }

  if (_listTree == null) _listTree = ListTree(_ast);
  return _listTree.list(root: root, followLinks: followLinks);
}