Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.sys/scala.sys.process/ProcessIO

ProcessIO

scala.sys.process.ProcessIO
finalclassProcessIO(valwriteInput:OutputStream=>Unit,valprocessOutput:InputStream=>Unit,valprocessError:InputStream=>Unit,valdaemonizeThreads:Boolean)

This class is used to control the I/O of everyscala.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 useProcessIO directly --scala.sys.process.ProcessBuilder can return the process output to the caller, or use ascala.sys.process.ProcessLogger which avoids direct interaction with a stream. One can even use the factories atBasicIO to create aProcessIO, or use its helper methods when creating one's ownProcessIO.

When creating aProcessIO, it is important toclose 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 callwriteInput,processOutput andprocessError in separate threads, and if daemonizeThreads is true, they will all be marked as daemon threads.

Value parameters

daemonizeThreads

Indicates whether the newly spawned threads that will runprocessOutput,processError andwriteInput should be marked as daemon threads.

processError

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

processOutput

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

writeInput

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

Attributes

Note

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

Source
ProcessIO.scala
Graph
Supertypes
classObject
traitMatchable
classAny

Members list

Value members

Constructors

defthis(in:OutputStream=>Unit,out:InputStream=>Unit,err:InputStream=>Unit)

Attributes

Source
ProcessIO.scala

Concrete methods

Creates a newProcessIO, withdaemonizeThreads true.

Creates a newProcessIO, withdaemonizeThreads true.

Attributes

Source
ProcessIO.scala
defwithError(process:InputStream=>Unit):ProcessIO

Creates a newProcessIO with a different handler for the error output.

Creates a newProcessIO with a different handler for the error output.

Attributes

Source
ProcessIO.scala
defwithInput(write:OutputStream=>Unit):ProcessIO

Creates a newProcessIO with a different handler for the process input.

Creates a newProcessIO with a different handler for the process input.

Attributes

Source
ProcessIO.scala
defwithOutput(process:InputStream=>Unit):ProcessIO

Creates a newProcessIO with a different handler for the normal output.

Creates a newProcessIO with a different handler for the normal output.

Attributes

Source
ProcessIO.scala

Concrete fields

valprocessError:InputStream=>Unit

Attributes

Source
ProcessIO.scala
valprocessOutput:InputStream=>Unit

Attributes

Source
ProcessIO.scala
valwriteInput:OutputStream=>Unit

Attributes

Source
ProcessIO.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp