Skip to content

Commit a8d355a

Browse files
authored
Merge pull request scala#6732 from xuwei-k/ProcessBuilder-LazyList
fix ProcessBuilder scaladoc. use LazyList instead of Stream
2 parents 2b49d71 + b504fe4 commit a8d355a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/library/scala/sys/process/ProcessBuilder.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import ProcessBuilder._
2929
* // Executes "ls" and sends output to stdout
3030
* "ls".!
3131
*
32-
* // Execute "ls" and assign a `Stream[String]` of its output to "contents".
33-
* val contents = Process("ls").lineStream
32+
* // Execute "ls" and assign a `LazyList[String]` of its output to "contents".
33+
* val contents = Process("ls").lazyLines
3434
*
3535
* // Here we use a `Seq` to make the parameter whitespace-safe
3636
* def contentsOf(dir: String): String = Seq("ls", dir).!!
@@ -80,29 +80,29 @@ import ProcessBuilder._
8080
* of the last one in the chain of execution.
8181
* - `!!`: blocks until all external commands exit, and returns a `String`
8282
* with the output generated.
83-
* - `lineStream`: returns immediately like `run`, and the output being generated
84-
* is provided through a `Stream[String]`. Getting the next element of that
85-
* `Stream` may block until it becomes available. This method will throw an
83+
* - `lazyLines`: returns immediately like `run`, and the output being generated
84+
* is provided through a `LazyList[String]`. Getting the next element of that
85+
* `LazyList` may block until it becomes available. This method will throw an
8686
* exception if the return code is different than zero -- if this is not
87-
* desired, use the `lineStream_!` method.
87+
* desired, use the `lazyLines_!` method.
8888
*
8989
* ==Handling Input and Output==
9090
*
9191
* If not specified, the input of the external commands executed with `run` or
9292
* `!` will not be tied to anything, and the output will be redirected to the
93-
* stdout and stderr of the Scala process. For the methods `!!` and `lineStream`, no
93+
* stdout and stderr of the Scala process. For the methods `!!` and `lazyLines`, no
9494
* input will be provided, and the output will be directed according to the
9595
* semantics of these methods.
9696
*
9797
* Some methods will cause stdin to be used as input. Output can be controlled
98-
* with a [[scala.sys.process.ProcessLogger]] -- `!!` and `lineStream` will only
98+
* with a [[scala.sys.process.ProcessLogger]] -- `!!` and `lazyLines` will only
9999
* redirect error output when passed a `ProcessLogger`. If one desires full
100100
* control over input and output, then a [[scala.sys.process.ProcessIO]] can be
101101
* used with `run`.
102102
*
103-
* For example, we could silence the error output from `lineStream_!` like this:
103+
* For example, we could silence the error output from `lazyLines_!` like this:
104104
* {{{
105-
* val etcFiles = "find /etc" lineStream_! ProcessLogger(line => ())
105+
* val etcFiles = "find /etc" lazyLines_! ProcessLogger(line => ())
106106
* }}}
107107
*
108108
* ==Extended Example==

0 commit comments

Comments
 (0)