listSync method

List<FileSystemEntity> listSync (
  1. {String root,
  2. bool followLinks: true}

Synchronously lists all FileSystemEntitys beneath root that match the glob.

This works much like Directory.listSync, 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.


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

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