ls function
Returns a stream of all paths on disk matching glob
.
The glob syntax is the same as that provided by the Glob
package.
If root
is passed, it's used as the root directory for relative globs.
Implementation
Stream<String> ls(String glob, {String? root}) {
var absolute = p.isAbsolute(glob);
return Glob(glob).list(root: root).map(
(entity) => absolute ? entity.path : p.relative(entity.path, from: root));
}