ripley@stats.ox.ac.uk
2000-Dec-20 13:15 UTC
[Rd] Inconsistency in creating/opening/closing/destroying (PR#788)
On Wed, 20 Dec 2000 joehl@web.de wrote:> I expected close() to be the opposite of open(), butWhy? It is not documented to be so, as far as I know.> > # create a connection > > con <- file("ex.data") > > # open it > > open(con, "w") > > # close it > > close(con) > > # re-open it > > open(con, "w") > Error in open.connection(con, "w") : invalid connection > > > > con > Error in summary.connection(x) : invalid connection > > # is obviously pointing to a non-existing connection > > help to showConnections obviously also was assuming that there may EXIST something like a CLOSED connection, as it says > all logical: if true all connections, including CLOSED ONES and the standard ones are displayed. If false only open user-created connections are included. > > So this is at least a documentation bug, but what about having something likeCan you please elucidate here? I don't think any documentation says open is the opposite of close. I think you are just assuming things that are not said. Note: ?close says `close' closes and destroys a connection. not just closes it, so there can be closed and not destroyed connections.> CreateConnection > OpenConnection > CloseConnection > DestroyConnection > > Is there any reason to have (as currently) OpenConnection seperated from CreateConnection but CloseConnection and DestroyConnection combined?Yes. These are S4-type connections, and that is what S4 does. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Possibly Parallel Threads
- Inconsistency in creating/opening/closing/destroying connections (PR#787)
- unlink() is not synchronized with existing connections (PR#785)
- unlink() is not synchronized with existing connections (PR#783)
- showConnections() does not show closed (or non-opened) connections though help says so (PR#784)
- closing the sink connection a) is possible and b) can't be undone (PR#782)