My solution the original post is to always set 'con - NULL' after closing a
connection, and then test for NULL. This is how I do to make sure to make
sure that opened connections are closed and as soon as possible.
foo - function(...) {
con - file(foo.R, open=r):
on.exit({
if
Upon further consideration, I realized there is a philosophical element
here---if a connection is closed and hence does not exist, is it open?
The practical issue for me is that when you do something like
close(con)
the 'con' object is still lying around and is essentially undefined. For
November 2007 11:48 PM
To: Prof Brian Ripley
Cc: R-devel mailing list
Subject: Re: [Rd] isOpen on closed connections
Upon further consideration, I realized there is a
philosophical element here---if a connection is closed and
hence does not exist, is it open?
The practical issue for me
As far as I can tell, 'isOpen' cannot return FALSE in the case when 'rw = '.
If the connection has already been closed by 'close' or some other function,
then isOpen will produce an error. The problem is that when isOpen calls
'getConnection', the connection cannot be found and 'getConnection'
Roger D. Peng [EMAIL PROTECTED] writes:
As far as I can tell, 'isOpen' cannot return FALSE in the case when 'rw =
'.
If the connection has already been closed by 'close' or some other function,
then isOpen will produce an error. The problem is that when isOpen calls
'getConnection', the