Displaying 20 results from an estimated 2000 matches similar to: "unlink() is not synchronized with existing connections"
2000 Dec 20
1
unlink() is not synchronized with existing connections (PR#783)
> # creating a file
> cat("sddfasdf", file="tempfile")
> showConnections()
class description mode text isopen can read can write
> con <- file("tempfile", "r")
> readLines(con)
[1] "sddfasdf"
Warning message:
incomplete final line in: readLines(con, n, ok)
> showConnections()
class description mode text isopen
2000 Dec 20
0
showConnections() does not show closed (or non-opened) connections though help says so (PR#784)
help on showConnections explains parameter
all logical: if true all connections, including closed ones and the standard ones are displayed. If false only open user-created connections are included.
but
> # create a file
> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file="ex.data",
+ sep="\n")
>
2000 Dec 20
1
showConnections() does not show closed (or non-opened) connections though help says so
help on showConnections explains parameter
all logical: if true all connections, including closed ones and the standard ones are displayed. If false only open user-created connections are included.
but
> # create a file
> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file="ex.data",
+ sep="\n")
>
2000 Dec 20
0
unlink() is not synchronized with existing connections (PR#785)
On Wed, 20 Dec 2000 joehl@web.de wrote:
> > # creating a file
> > cat("sddfasdf", file="tempfile")
> > showConnections()
> class description mode text isopen can read can write
> > con <- file("tempfile", "r")
> > readLines(con)
> [1] "sddfasdf"
> Warning message:
> incomplete final line in:
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
On Thu, Dec 14, 2017 at 12:17 PM, G?bor Cs?rdi <csardi.gabor at gmail.com>
wrote:
> On Thu, Dec 14, 2017 at 7:56 PM, Gabriel Becker <gmbecker at ucdavis.edu>
> wrote:
> > Gabor,
> >
> > You can grab the connection and destroy it via getConnection and then a
> > standard close call.
>
> Yeah, that's often a possible workaround, but since this
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
This has nothing to do with on.exit. It is an iteraction between where
the warning is signaled in 'file' and your _exiting_ warning handler.
This combination has the same issue,
tryCatch(file(tempfile(), "r"), warning = identity)
showConnections(all = TRUE)
as does
options(warn=2)
file(tempfile(), "r")
showConnections(all = TRUE)
I haven't looked at the
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
Gabor,
You can grab the connection and destroy it via getConnection and then a
standard close call. (it actually lists that it is "closed" already, but
still in the set of existing connections. I can't speak to that difference).
> tryCatch(
+ readLines(tempfile(), warn = FALSE)[1],
+ error = function(e) NA,
+ warning = function(w) NA
+ )
[1] NA
>
2009 May 21
3
file descriptor leak in getSrcLines in R 2.10.0 svn 48590
I noticed the following file descriptor leak when I couldn't remove
a package unless I shut down the R session that had loaded and
used it. The function that triggered the problem printed the output
of a call to parse(). Each time one prints a srcref a connection is
opened and not closed. It looks like it happens in
as.character.srcref's
call to getSrcLines, which has some logic I
2017 Dec 15
1
cannot destroy connection (?) created by readLines in a tryCatch
Thanks for tracking this down. Yeah, I should use suppressWarnings(),
you are right.
Although, readLines() might throw another warning, e.g. for incomplete
last lines,
and you don't necessarily want to suppress that.
TBH I am not sure why that warning is given:
? con <- file(tempfile())
? open(con)
Error in open.connection(con) : cannot open the connection
In addition: Warning message:
In
2000 Dec 20
0
closing the sink connection a) is possible and b) can't be undone (PR#782)
# Have no other connections opened yet
> showConnections()
class description mode text isopen can read can write
> sink("tempfile")
> close(getConnection(3))
> cat("send some output\n")
Error in stdout() : invalid connection
> sink()
Error in sink() : invalid connection
> cat("send some output\n")
Error in stdout() : invalid connection
>
2000 Dec 20
0
closing the sink connection a) is possible and b) can't be undone
# Have no other connections opened yet
> showConnections()
class description mode text isopen can read can write
> sink("tempfile")
> close(getConnection(3))
> cat("send some output\n")
Error in stdout() : invalid connection
> sink()
Error in sink() : invalid connection
> cat("send some output\n")
Error in stdout() : invalid connection
>
2017 Dec 14
4
cannot destroy connection (?) created by readLines in a tryCatch
On Thu, Dec 14, 2017 at 7:56 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote:
> Gabor,
>
> You can grab the connection and destroy it via getConnection and then a
> standard close call.
Yeah, that's often a possible workaround, but since this connection
was opened by
readLines() internally, I don't necessarily know which one it is. E.g.
I might open multiple
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:
?
2005 Feb 01
2
assign connections automatically
Hi all,
I am trying to create a function that will open connections to all
files of
one type within the working directory.
I've got the function to open the connections, but I am having a
bugger of a
time trying to get these connections named as objects in the workspace.
I am at the point where I can do it outside of the function, but not
inside, using assign. I'm sure I'm
2000 Dec 28
1
some (may be related) problems with windows(rescale=) (PR#794)
###############################################################################
Before reporting 4 problems with windows(rescale=) I want to congrat on R1.2 and to thank r-developers for quickly adding the rescale workaround to the windows version.
Happy New Year
Jens Oehlschlaegel
###############################################################################
2007 Dec 27
0
Too many open files
Dear all,
Did this problem that was posted in 2006 (see below) ever got fully resolved
?
I am encountering the exact same issue
; I have executed get.hist.quote() in a loop and now R not only refuses to
establish any further connections to yahoo, but, worse, it will not open any
files either. For example, I cannot even save my current workspace for that
reason.
I tried
closeAllConnections()
As
2018 Oct 31
1
PATCH: Asserting that 'connection' used has not changed + R_GetConnection2()
SUMMARY:
I'm proposing that R assert that 'connection' options have not changed
since first created such that R will produce the following error:
> fh <- file("a.txt", open = "w+")
> cat("hello\n", file = fh)
> close(fh)
> fh2 <- file("b.txt", open = "w+")
> cat("world\n", file = fh2)
>
2000 Dec 10
0
Patents on algorithms harm data analytic services
Cologne, 10.12.00
Dear Sir,
Dear Madam,
We are concerned about the possibility that the European Commission might introduce software patenting into the European Community because we think this will harm our profession.
We make our living on data management and statistical analyses. Modern statistics crucially depends on algorithms [cf. Venables, W. N., & Ripley, B. D. (1999). Modern applied
2013 Jun 19
2
Ryacas loads but yacas has an error
Hello yet again, R People:
I was working with Ryacas and yacas last night and all was well.
Now this morning, I keep getting the following:
> a <- Sym("a")
> a
Error in summary.connection(x) : invalid connection
>
When I go to yacas from the command line, it works fine.
Any suggestions, please?
I'm thinking that a port might be open, but here I have:
>
2007 Jul 03
1
bug in closing gzfile-opened connections?
Hi,
I am making multiple calls to gzfile() via read.table(), e.g.
> x <- read.table( gzfile( "xxx.gz" ) )
After i do this many times (I haven't counted, but probably between 50 and
100 times) I get the error message:
Error in open.connection(file, "r") : unable to open connection
In addition: Warning message:
cannot open compressed file 'xxx.gz'
however, I