[Rd] Clipboard connections (PR#8668)

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Mar 9 08:40:02 CET 2006


This is not a bug, but user error.  You are failing to close the 
connection.  R has no idea you do not subsequently want to use the 
connection via getConnection.  As the help page ?file and its reference, 
and also the R-news article on connections.

The correct usage is either

source("clipboard")

or

zz <- file("clipboard")
source(zz)
close(zz)

BTW, there are no `clipboard connections': there are file connections to 
the clipboard on Windows only.


On Wed, 8 Mar 2006, graywh at gmail.com wrote:

> Full_Name: Will Gray
> Version: R 2.2.1
> OS: WinXP SP2
> Submission from: (NULL) (160.129.18.69)
>
>
> I've been using R with a text editor (Tinn-R) and using a feature of the editor
> that sends code to a running R session.  Sometimes it is convenient to use the
> command "source(file('clipboard'))" to send whole blocks of code.  However, this
> quickly fills up the limit of 50 connections, even if 47 are closed.  What does
> R hold on to connections it doesn't need, and especially multiple closed
> connections to the clipboard?  Should this be changed?
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley at 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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list