Displaying 6 results from an estimated 6 matches for "l_n_5qr152d2d9d9xs0591lh0000gn".
2017 Dec 14
4
cannot destroy connection (?) created by readLines in a tryCatch
...592000 31.7 416371 22.3
>
> Vcells 536411 4.1 8388608 64.0 1795667 13.7
>
>>
>
>> showConnections(all = TRUE)
>
> description
>
> 0 "stdin"
>
> 1 "stdout"
>
> 2 "stderr"
>
> 3
> "/var/folders/79/l_n_5qr152d2d9d9xs0591lh0000gn/T//RtmpZRcxmh/file128a13bffc77"
>
> class mode text isopen can read can write
>
> 0 "terminal" "r" "text" "opened" "yes" "no"
>
> 1 "terminal" "w" "text" "opened&quo...
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
...setting of a warning handler in tryCatch that does it
actually; without that, it works as expected, even when errors are caught.
tryCatch(readLines(tempfile(), warn=FALSE), error=function(x) NA)
[1] NA
*Warning message:*
*In file(con, "r") :*
* cannot open file
'/var/folders/79/l_n_5qr152d2d9d9xs0591lh0000gn/T//RtmpzIZ6Qh/file1ed2e57f2ea':
No such file or directory*
> showConnections(all=TRUE)
description class mode text isopen can read can write
0 "stdin" "terminal" "r" "text" "opened" "yes" "no"
1 &quo...
2017 Dec 14
2
cannot destroy connection (?) created by readLines in a tryCatch
Consider this code. This is R 3.4.2, but based on a quick look at the
NEWS, this has not been fixed.
tryCatch(
readLines(tempfile(), warn = FALSE)[1],
error = function(e) NA,
warning = function(w) NA
)
rm(list=ls(all.names = TRUE))
gc()
showConnections(all = TRUE)
If you run it, you'll get a connection you cannot close(), i.e. the
last showConnections() call prints:
?
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
...used (Mb) gc trigger (Mb) max used (Mb)
Ncells 257895 13.8 592000 31.7 416371 22.3
Vcells 536411 4.1 8388608 64.0 1795667 13.7
>
> showConnections(all = TRUE)
description
0 "stdin"
1 "stdout"
2 "stderr"
3
"/var/folders/79/l_n_5qr152d2d9d9xs0591lh0000gn/T//RtmpZRcxmh/file128a13bffc77"
class mode text isopen can read can write
0 "terminal" "r" "text" "opened" "yes" "no"
1 "terminal" "w" "text" "opened" "no" "...
2017 Dec 15
1
cannot destroy connection (?) created by readLines in a tryCatch
...t; showConnections(all = TRUE)
>>>
>>>
>>> description
>>>
>>> 0 "stdin"
>>>
>>> 1 "stdout"
>>>
>>> 2 "stderr"
>>>
>>> 3
>>>
>>> "/var/folders/79/l_n_5qr152d2d9d9xs0591lh0000gn/T//RtmpZRcxmh/file128a13bffc77"
>>>
>>> class mode text isopen can read can write
>>>
>>> 0 "terminal" "r" "text" "opened" "yes" "no"
>>>
>>> 1 "terminal"...
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
...8388608 64.0 1795667 13.7
>>
>>>
>>
>>> showConnections(all = TRUE)
>>
>> description
>>
>> 0 "stdin"
>>
>> 1 "stdout"
>>
>> 2 "stderr"
>>
>> 3
>> "/var/folders/79/l_n_5qr152d2d9d9xs0591lh0000gn/T//RtmpZRcxmh/file128a13bffc77"
>>
>> class mode text isopen can read can write
>>
>> 0 "terminal" "r" "text" "opened" "yes" "no"
>>
>> 1 "terminal" "w" "tex...