Re: [Rd] Enhancement request: anonymous connections

From: Seth Falcon <sfalcon_at_fhcrc.org>
Date: Wed 28 Dec 2005 - 14:50:25 GMT

On 27 Dec 2005, murdoch@stats.uwo.ca wrote:
> This is a bug in load, isn't it? load() opens the connection but
> doesn't close it.

Well, it may be that load needs a small fix, but that doesn't fix anonymous connections in general, IMO.

The loop could easily have been:

for (i in 1:50) {

    print(load(url(testUrl, open="r")))
}

And it doesn't need to be related to url or load:

cat("a line of text\n", file="another-example.txt") z <- NULL
for (i in 1:50) {

    z <- c(z, readLines(file("another-example.txt", open="r"))) }

Also, connections are "in use" even if they are closed:

for (i in 1:50) {

    if (isOpen(file("another-example.txt")))

        stop("you will not get here")
}

--
+ seth

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu Dec 29 02:00:46 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:35 GMT