case class ProcGroup extends Product with Serializable
A group of processes that are piped together, corresponding to e.g. ls -l | grep .scala.
You can create a ProcGroup by calling .pipeTo on a proc multiple times.
Contains methods corresponding to the methods on proc, but defined for pipelines
of processes.
- Alphabetic
- By Inheritance
- ProcGroup
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
call(cwd: Path = null, env: Map[String, String] = null, stdin: ProcessInput = Pipe, stdout: ProcessOutput = Pipe, stderr: ProcessOutput = os.Inherit, mergeErrIntoOut: Boolean = false, timeout: Long = -1, check: Boolean = true, propagateEnv: Boolean = true, pipefail: Boolean = true, handleBrokenPipe: Boolean = !isWindows): CommandResult
Invokes the given pipeline like a function, passing in input and returning a CommandResult.
Invokes the given pipeline like a function, passing in input and returning a CommandResult. You can then call
result.exitCodeto see how it exited, orresult.out.bytesorresult.err.stringto access the aggregated stdout and stderr of the subprocess in a number of convenient ways. If a non-zero exit code is returned, this throws a os.SubprocessException containing the CommandResult, unless you pass incheck = false.For each process in pipeline, the output will be forwarded to the input of the next process. Input of the first process is set to provided stdin The output of the last process will be returned as the output of the pipeline. stderr is set for all processes.
callprovides a number of parameters that let you configure how the pipeline is run:- cwd
the working directory of the pipeline
- env
any additional environment variables you wish to set in the pipeline
- stdin
any data you wish to pass to the pipelines's standard input (to the first process)
- stdout
How the pipelines's output stream is configured (the last process stdout)
- stderr
How the process's error stream is configured (set for all processes)
- mergeErrIntoOut
merges the pipeline's stderr stream into it's stdout. Note that then the stderr will be forwarded with stdout to subsequent processes in the pipeline.
- timeout
how long to wait in milliseconds for the pipeline to complete
- check
disable this to avoid throwing an exception if the pipeline fails with a non-zero exit code
- propagateEnv
disable this to avoid passing in this parent process's environment variables to the pipeline
- pipefail
if true, the pipeline's exitCode will be the exit code of the first failing process. If no process fails, the exit code will be 0.
- handleBrokenPipe
if true, every java.io.IOException when redirecting output of a process will be caught and handled by killing the writing process. This behaviour is consistent with handlers of SIGPIPE signals in most programs supporting interruptable piping. Disabled by default on Windows.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val commands: Seq[proc]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pipeTo(next: proc): ProcGroup
Pipes the output of this pipeline into the input of the next process.
-
def
spawn(cwd: Path = null, env: Map[String, String] = null, stdin: ProcessInput = Pipe, stdout: ProcessOutput = Pipe, stderr: ProcessOutput = os.Inherit, mergeErrIntoOut: Boolean = false, propagateEnv: Boolean = true, pipefail: Boolean = true, handleBrokenPipe: Boolean = !isWindows): ProcessPipeline
The most flexible of the os.ProcGroup calls.
The most flexible of the os.ProcGroup calls. It sets-up a pipeline of processes, and returns a ProcessPipeline for you to interact with however you like.
Note that if you provide
ProcessOutputcallbacks tostdout/stderr, the calls to those callbacks take place on newly spawned threads that execute in parallel with the main thread. Thus make sure any data processing you do in those callbacks is thread safe!- cwd
the working directory of the pipeline
- env
any additional environment variables you wish to set in the pipeline
- stdin
any data you wish to pass to the pipelines's standard input (to the first process)
- stdout
How the pipelines's output stream is configured (the last process stdout)
- stderr
How the process's error stream is configured (set for all processes)
- mergeErrIntoOut
merges the pipeline's stderr stream into it's stdout. Note that then the stderr will be forwarded with stdout to subsequent processes in the pipeline.
- propagateEnv
disable this to avoid passing in this parent process's environment variables to the pipeline
- pipefail
if true, the pipeline's exitCode will be the exit code of the first failing process. If no process fails, the exit code will be 0.
- handleBrokenPipe
if true, every java.io.IOException when redirecting output of a process will be caught and handled by killing the writing process. This behaviour is consistent with handlers of SIGPIPE signals in most programs supporting interruptable piping. Disabled by default on Windows.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()