File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -973,7 +973,7 @@ defmodule File do
973
973
of bytes given by `line_or_bytes`.
974
974
975
975
The returned stream will fail for the same reasons as `File.open!`.
976
- Note that the file is opened only when streaming begins.
976
+ Note that the file is opened only and every time streaming begins.
977
977
"""
978
978
def stream! ( file , mode // [ ] , line_or_bytes // :line ) do
979
979
fn ( acc , fun ) ->
@@ -992,7 +992,7 @@ defmodule File do
992
992
of bytes given by `line_or_bytes`.
993
993
994
994
The returned stream will fail for the same reasons as `File.open!`.
995
- Note that the file is opened only when streaming begins.
995
+ Note that the file is opened only and every time streaming begins.
996
996
"""
997
997
def binstream! ( file , mode // [ ] , line_or_bytes // :line ) do
998
998
fn ( fun , acc ) ->
Original file line number Diff line number Diff line change @@ -224,12 +224,15 @@ defmodule IO do
224
224
225
225
@ doc """
226
226
Converts the io device into a Stream. The device is
227
- iterated line by line if :line is given or by a given
227
+ iterated line by line if ` :line` is given or by a given
228
228
number of codepoints.
229
229
230
- This reads the io as utf-8. Check out
230
+ This reads the IO as utf-8. Check out
231
231
`IO.binstream/2` to handle the IO as a raw binary.
232
232
233
+ Note that an IO stream has side effects and every time
234
+ you go over the stream you may get different results.
235
+
233
236
## Examples
234
237
235
238
Here is an example on how we mimic an echo server
@@ -245,9 +248,11 @@ defmodule IO do
245
248
246
249
@ doc """
247
250
Converts the io device into a Stream. The device is
248
- iterated line by line.
251
+ iterated line by line or by a number of bytes. This
252
+ reads the IO as a raw binary.
249
253
250
- This reads the io as a raw binary.
254
+ Note that an IO stream has side effects and every time
255
+ you go over the stream you may get different results.
251
256
"""
252
257
@ spec binstream ( device , :line | pos_integer ) :: Enumerable . t
253
258
def binstream ( device , line_or_bytes ) do
You can’t perform that action at this time.
0 commit comments