Class

scala.sys.process

ProcessIO

Related Doc: package process

Permalink

final class ProcessIO extends AnyRef

This class is used to control the I/O of every scala.sys.process.Process. The functions used to create it will be called with the process streams once it has been started. It might not be necessary to use ProcessIO directly -- scala.sys.process.ProcessBuilder can return the process output to the caller, or use a scala.sys.process.ProcessLogger which avoids direct interaction with a stream. One can even use the factories at BasicIO to create a ProcessIO, or use its helper methods when creating one's own ProcessIO.

When creating a ProcessIO, it is important to close all streams when finished, since the JVM might use system resources to capture the process input and output, and will not release them unless the streams are explicitly closed.

ProcessBuilder will call writeInput, processOutput and processError in separate threads, and if daemonizeThreads is true, they will all be marked as daemon threads.

Note

Failure to close the passed streams may result in resource leakage.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProcessIO
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ProcessIO(in: (OutputStream) ⇒ Unit, out: (InputStream) ⇒ Unit, err: (InputStream) ⇒ Unit)

    Permalink
  2. new ProcessIO(writeInput: (OutputStream) ⇒ Unit, processOutput: (InputStream) ⇒ Unit, processError: (InputStream) ⇒ Unit, daemonizeThreads: Boolean)

    Permalink

    writeInput

    Function that will be called with the OutputStream to which all input to the process must be written. This will be called in a newly spawned thread.

    processOutput

    Function that will be called with the InputStream from which all normal output of the process must be read from. This will be called in a newly spawned thread.

    processError

    Function that will be called with the InputStream from which all error output of the process must be read from. This will be called in a newly spawned thread.

    daemonizeThreads

    Indicates whether the newly spawned threads that will run processOutput, processError and writeInput should be marked as daemon threads.

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 clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val daemonizeThreads: Boolean

    Permalink

    Indicates whether the newly spawned threads that will run processOutput, processError and writeInput should be marked as daemon threads.

  7. def daemonized(): ProcessIO

    Permalink

    Creates a new ProcessIO, with daemonizeThreads true.

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

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. val processError: (InputStream) ⇒ Unit

    Permalink

    Function that will be called with the InputStream from which all error output of the process must be read from.

    Function that will be called with the InputStream from which all error output of the process must be read from. This will be called in a newly spawned thread.

  18. val processOutput: (InputStream) ⇒ Unit

    Permalink

    Function that will be called with the InputStream from which all normal output of the process must be read from.

    Function that will be called with the InputStream from which all normal output of the process must be read from. This will be called in a newly spawned thread.

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

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def withError(process: (InputStream) ⇒ Unit): ProcessIO

    Permalink

    Creates a new ProcessIO with a different handler for the error output.

  25. def withInput(write: (OutputStream) ⇒ Unit): ProcessIO

    Permalink

    Creates a new ProcessIO with a different handler for the process input.

  26. def withOutput(process: (InputStream) ⇒ Unit): ProcessIO

    Permalink

    Creates a new ProcessIO with a different handler for the normal output.

  27. val writeInput: (OutputStream) ⇒ Unit

    Permalink

    Function that will be called with the OutputStream to which all input to the process must be written.

    Function that will be called with the OutputStream to which all input to the process must be written. This will be called in a newly spawned thread.

Inherited from AnyRef

Inherited from Any

Ungrouped