ancestors method

Iterable<Path> ancestors()

Produces an iterator over Path and its ancestors. e.g. /a/b/c will produce /a/b/c, /a/b, /a, and /.

Implementation

Iterable<Path> ancestors() => isWindows
    ? WindowsPath(_string).ancestors().map((e) => Path(e._string))
    : UnixPath(_string).ancestors().map((e) => Path(e._string));