From ripley at stats.ox.ac.uk  Wed Apr 25 13:38:55 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 25 Apr 2007 12:38:55 +0100 (BST)
Subject: [Rd] R-2.5.0 and unlink/wildcards
In-Reply-To: <F4683CA2-ACD2-4647-9C1D-0C4A01892B1E@ic.ac.uk>
References: <F4683CA2-ACD2-4647-9C1D-0C4A01892B1E@ic.ac.uk>
Message-ID: <Pine.LNX.4.64.0704251234500.7115@gannet.stats.ox.ac.uk>

This is shell-dependent on a Unix-alike, but Sys.glob() should work.  So 
try

unlink(Sys.glob("run.*"), recursive=TRUE)


On Wed, 25 Apr 2007, Ernest Turro wrote:

> It seems unlink doesn't work with wildcards in 2.5.0. I've tried
> R-2.5.0 under gnu/linux from source and the Mac binary from att
> research. Example:
>
> > dir()
> [1] "bgx.Rnw" "bgx.pdf" "run.1"
> > unlink("run.*",recursive=T)
> > dir()
> [1] "bgx.Rnw" "bgx.pdf" "run.1"
> > unlink("run.1",recursive=T)
> > dir()
> [1] "bgx.Rnw" "bgx.pdf"

-- 
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] R-2.5.0 and unlink/wildcards
Prof Brian Ripley