A ProcessLogger that writes output to a file.
Represents a process that is running or has finished running.
Represents a runnable process.
Factories for creating ProcessBuilder.
This class is used to control the I/O of every ProcessBuilder.
Provide implicit conversions for the factories offered by Process's companion object.
Encapsulates the output and error streams of a running process.
This object contains factories for ProcessIO,
which can be used to control the I/O of a Process
when a ProcessBuilder is started with the run
command.
Methods for constructing simple commands that can then be combined.
This object contains traits used to describe input and output sources.
Provides factories to create ProcessLogger, which are used to capture output of ProcessBuilder commands when run.
Implicitly convert a java.lang.ProcessBuilder into a Scala one.
Implicitly convert a java.lang.ProcessBuilder into a Scala one.
Return a sequence of Source from a sequence
of values for which an implicit conversion to Source is available.
Return a sequence of Source from a sequence
of values for which an implicit conversion to Source is available.
Implicitly convert a java.io.File into a ProcessBuilder
Implicitly convert a java.io.File into a ProcessBuilder
Implicitly convert a sequence of String into a ProcessBuilder
Implicitly convert a sequence of String into a ProcessBuilder
Implicitly convert a String into a ProcessBuilder
Implicitly convert a String into a ProcessBuilder
Implicitly convert a java.net.URL into a ProcessBuilder
Implicitly convert a java.net.URL into a ProcessBuilder
Implicitly convert a Elem into a ProcessBuilder
Implicitly convert a Elem into a ProcessBuilder
This package is used to create process pipelines, similar to Unix command pipelines.
The key concept is that one builds a Process that will run and return an exit value. This
Processis usually composed of one or more ProcessBuilder, fed by a Source and feeding a Sink. AProcessBuilderitself is both aSourceand aSink.As
ProcessBuilder,SinkandSourceare abstract, one usually creates them withapplymethods on the companion object of Process, or through implicit conversions available in this package object fromStringand other types. The pipe is composed through unix-like pipeline and I/O redirection operators available on ProcessBuilder.The example below shows how to build and combine such commands. It searches for
nulluses in thesrcdirectory, printing a message indicating whether they were found or not. The first command pipes its output to the second command, whose exit value is then used to choose between the third or fourth commands. This same example is explained in greater detail on ProcessBuilder.Other implicits available here are for FileBuilder, which extends both
SinkandSource, and for URLBuilder, which extendsSourcealone.One can even create a
Processsolely out of these, without running any command. For example, this will download from a URL to a file:One may use a
Processdirectly throughProcessBuilder'srunmethod, which starts the process in the background, and returns aProcess. If background execution is not desired, one can get aProcessBuilderto execute through a method such as!,lines,runor variations thereof. That will create theProcessto execute the commands, and return either the exit value or the output, maybe throwing an exception.Finally, when executing a
ProcessBuilder, one may pass a ProcessLogger to capture stdout and stderr of the executing processes. AProcessLoggermay be created through its companion object from functions of type(String) => Unit, or one might redirect it to a file, using FileProcessLogger, which can also be created throughProcessLogger's object companion.