From ripley at stats.ox.ac.uk  Thu Mar  9 08:40:02 2006
From: ripley at stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Thu,  9 Mar 2006 08:40:02 +0100 (CET)
Subject: [Rd] Clipboard connections (PR#8668)
Message-ID: <20060309074002.A23873FC9F@slim.kubism.ku.dk>

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



[Rd] Clipboard connections (PR#8668)
ripley@stats.ox.ac.uk