The Scala Toolkit

Working with files and processes with OS-Lib

Language
Info: JavaScript is currently disabled, code tabs will still work, but preferences will not be remembered.

OS-Lib is a library for manipulating files and processes. It is part of the Scala Toolkit.

OS-Lib aims to replace the java.nio.file and java.lang.ProcessBuilder APIs. You should not need to use any underlying Java APIs directly.

OS-lib also aims to supplant the older scala.io and scala.sys APIs in the Scala standard library.

OS-Lib has no dependencies.

All of OS-Lib is in the os.* namespace.

You can require the entire toolkit in a single line:

//> using toolkit latest

Alternatively, you can require just a specific version of OS-Lib:

//> using dep com.lihaoyi::os-lib:0.11.3

In your build.sbt, you can add a dependency on the toolkit:

lazy val example = project.in(file("."))
 .settings(
 scalaVersion := "3.4.2",
 libraryDependencies += "org.scala-lang" %% "toolkit" % "0.7.0"
 )

Alternatively, you can require just a specific version of OS-Lib:

libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.11.3"

In your build.sc file, you can add a dependency on the Toolkit:

object example extends ScalaModule {
 def scalaVersion = "3.4.2"
 def ivyDeps =
 Agg(
 ivy"org.scala-lang::toolkit:0.7.0"
 )
}

Alternatively, you can require just a specific version of OS-Lib:

ivy"com.lihaoyi::os-lib:0.11.3"

Contributors to this page:

Contents

AltStyle によって変換されたページ (->オリジナル) /