From sfalcon at fhcrc.org  Wed Dec 28 15:50:25 2005
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 28 Dec 2005 06:50:25 -0800
Subject: [Rd] Enhancement request: anonymous connections
In-Reply-To: <43B1EE08.4090003@stats.uwo.ca> (Duncan Murdoch's message of "Tue,
	27 Dec 2005 20:44:40 -0500")
References: <m2mzimc9zj.fsf@fhcrc.org> <43B1EE08.4090003@stats.uwo.ca>
Message-ID: <m2ek3xcm32.fsf@fhcrc.org>

On 27 Dec 2005, murdoch at 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



[Rd] Enhancement request: anonymous connections
Seth Falcon