From P.Dalgaard at biostat.ku.dk  Wed Apr 25 13:47:22 2007
From: P.Dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Wed, 25 Apr 2007 13:47:22 +0200
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: <462F3FCA.6000709@biostat.ku.dk>

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"
>
>   
Yes. The argument is now passed through shQuote, and that has the side
effect of removing wildcard expansions. If this was intentional, someone
forgot to change the help page...

Presumably, the change was done to prevent issues with embedded spaces:
unlink("Program Files") would otherwise delete "Program" and "Files". It
is not obvious to me how this can be achieved  while retaining wildcard
expansion.

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] R-2.5.0 and unlink/wildcards
Peter Dalgaard