fs2
fs2 copied to clipboard
Add `Files.walkWithAttributes`
This provides better performance than Files[F].walk(path).evalMap(p => p -> Files[F].getBasicFileAttributes(p)) given that all implementations of walk use file attributes.
Some use cases:
Computing cumulative size of a tree:
Files[F].walkWithAttributes(path).map(_.attributes.size).compile.foldMonoid
Getting all directories in a tree:
Files[F].walkWithAttributes(path).filter(_.attributes.isDirectory)