# OS-Lib: a simple filesystem & subprocess library

**URL:** <https://users.scala-lang.org/t/os-lib-a-simple-filesystem-subprocess-library/3521>\
**Category:** Libraries\
**Created:** [November 6, 2018, 1:45am UTC](https://users.scala-lang.org/t/os-lib-a-simple-filesystem-subprocess-library/3521 "2018-11-06T01:45:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lihaoyi](https://users.scala-lang.org/user_avatar/users.scala-lang.org/lihaoyi/32/290_2.png) [@lihaoyi](https://users.scala-lang.org/u/lihaoyi)\
**Post date:** [November 6, 2018, 1:45am UTC](https://users.scala-lang.org/t/os-lib-a-simple-filesystem-subprocess-library/3521/1 "2018-11-06T01:45:50Z")

</div>

- [GitHub - com-lihaoyi/os-lib: OS-Lib is a simple, flexible, high-performance Scala interface to common OS filesystem and subprocess APIs](https://github.com/lihaoyi/os-lib)

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!

---

<div class="post-metadata">

**Author:** ![som-snytt](https://users.scala-lang.org/letter_avatar_proxy/v4/letter/s/7cd45c/32.png) [@som-snytt](https://users.scala-lang.org/u/som-snytt)\
**Post date:** [November 6, 2018, 7:33am UTC](https://users.scala-lang.org/t/os-lib-a-simple-filesystem-subprocess-library/3521/2 "2018-11-06T07:33:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sadhen](https://users.scala-lang.org/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@sadhen](https://users.scala-lang.org/u/sadhen)\
**Post date:** [November 6, 2018, 6:57pm UTC](https://users.scala-lang.org/t/os-lib-a-simple-filesystem-subprocess-library/3521/3 "2018-11-06T18:57:28Z")

</div>

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.
