[Rd] R-2.5.0 and unlink/wildcards

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Wed Apr 25 13:47:22 CEST 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"
>
>   
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



More information about the R-devel mailing list