Class

os

ProcGroup

Related Doc: package os

Permalink

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.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProcGroup
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. 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

    Permalink

    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.exitCode to see how it exited, or result.out.bytes or result.err.string to 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 in check = 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.

    call provides 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.

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val commands: Seq[proc]

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def pipeTo(next: proc): ProcGroup

    Permalink

    Pipes the output of this pipeline into the input of the next process.

  16. 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

    Permalink

    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 ProcessOutput callbacks to stdout/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.

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped