ctongfei / poly-io

The missing I/O library for Scala

GitHub

Poly-io

Travis CI Maven Central Scaladoc

Poly-io is a lightweight (no-dependencies), typesafe and easy-to-use library for file system I/O in Scala (2.11/2.12).

    libraryDependencies += "me.tongfei" %% "poly-io" % "0.3.2"

Features

Fluent idiomatic-Scala style file I/O
import poly.io.Local._

val lines = File("/usr/local/...").lines // type: Iterable[String]
val li = File("/home/foo/bar.gz") decompress Gzip decode Codec.ISOLatin1 linesIterator // type: Iterator[String]
Typesafe (dependent-type based) filesystem manipulation
val files = Local.Directory("/home/foo/a").recursiveChildren // type: Iterable[Local.Path]
val zipFile = files.find(_.name endsWith "zip").get
val z = ZipArchive(zipFile)
val filesInZip = z.root.recursiveChildren // type: Iterable[z.Path]

Documentation

TODO