fs2 icon indicating copy to clipboard operation
fs2 copied to clipboard

Add `Files.walkWithAttributes`

Open mpilquist opened this issue 1 year ago • 0 comments

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)

mpilquist avatar Feb 17 '24 16:02 mpilquist