Displaying 4 results from an estimated 4 matches for "randymbpro".
2018 Apr 25
2
readLines() for non-blocking pipeline behaves differently in R 3.5
...m STDIN line by line.
```
con <- file("stdin")
open(con, blocking = FALSE)
while (TRUE) {
? ? txt <- readLines(con, 1)
? ? if (length(txt) > 0) {
? ? ? ? cat(txt, "\n", file = stdout())
? ? }
? ? Sys.sleep(0.1)
}
close(con)
```
In R 3.4.4, it works as expected.
```
(randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
abc
foo
```
In R 3.5, only the first line is printed
```
(randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
abc
```
Is this change expected? ?If I change `blocking` to `TRUE` above, the above code would
work. But I need...
2018 Apr 26
2
readLines() for non-blocking pipeline behaves differently in R 3.5
...t;- readLines(con, 1)
>> if (length(txt) > 0) {
>> cat(txt, "\n", file = stdout())
>> }
>> Sys.sleep(0.1)
>> }
>> close(con)
>>
>> ```
>>
>> In R 3.4.4, it works as expected.
>>
>> ```
>> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
>> abc
>> foo
>> ```
>>
>> In R 3.5, only the first line is printed
>> ```
>> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
>> abc
>> ```
>>
>> Is this...
2018 Apr 26
0
readLines() for non-blocking pipeline behaves differently in R 3.5
...ng = FALSE)
>
> while (TRUE) {
> txt <- readLines(con, 1)
> if (length(txt) > 0) {
> cat(txt, "\n", file = stdout())
> }
> Sys.sleep(0.1)
> }
> close(con)
>
> ```
>
> In R 3.4.4, it works as expected.
>
> ```
> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
> abc
> foo
> ```
>
> In R 3.5, only the first line is printed
> ```
> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
> abc
> ```
>
> Is this change expected? If I change `blocking` to...
2018 Apr 26
0
readLines() for non-blocking pipeline behaves differently in R 3.5
...t) > 0) {
>>> cat(txt, "\n", file = stdout())
>>> }
>>> Sys.sleep(0.1)
>>> }
>>> close(con)
>>>
>>> ```
>>>
>>> In R 3.4.4, it works as expected.
>>>
>>> ```
>>> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
>>> abc
>>> foo
>>> ```
>>>
>>> In R 3.5, only the first line is printed
>>> ```
>>> (randymbpro)-Desktop$ echo "abc\nfoo" | R --slave -f test.R
>>> abc
>&g...