OS-Lib: a simple filesystem & subprocess library

Just published OS-Lib, a new library that now underlies the Ammonite REPL, Ammonite-Ops (which is now just a wrapper around OS-Lib for backwards compatibility) and the Mill build tool.

OS-Lib is a simple Scala interface to common OS filesystem and subprocess APIs. OS-Lib aims to make working with files and processes in Scala as simple as any scripting language, while still providing the safety, flexibility and performance you would expect from Scala.

OS-Lib aims to be a complete replacement for the java.nio.file.Files / java.nio.file.Paths , java.lang.ProcessBuilder scala.io and scala.sys APIs. You should not need to drop down to underlying Java APIs, as OS-Lib exposes all relevant capabilities in an intuitive and performant way. OS-Lib has no dependencies and is unopinionated: it exposes the underlying APIs is a concise but straightforward way, without introducing it’s own idiosyncrasies, quirks, or clever DSLs.

Try it out!

This is great to hear, because I just spent a day trying to understand scala.sys.process.

Haven’t tried the subprocess part.

But the abstraction on filesystems is intuitive.

Just like the word intuitive, I’ve never used it before when writing in English. But it came out of my fingers just now. I’m not confident of my writing English. As a result, just checked the spelling and meaning on a online english2chinese dictionary. However, for programming, only a tab completion is required.

1 Like