R2.1.0: Bug in list.files
On Thu, 12 May 2005, Suresh Krishna wrote:
Is that the entire story ? I tried this with yesterday's patched version (windows xp) and found:
list.files(getwd(),"*.txt",full=T)
Error in list.files(path, pattern, all.files, full.names, recursive) :
invalid 'pattern' regular expression
list.files(getwd(),'.txt',full=T)
[1] "C:/Documents and Settings/suresh/BDE_SysInfo.txt" [2] "C:/Documents and Settings/suresh/dxva_sig.txt" Replacing "*.txt" with '*.txt' seems to do "something".
It finds any file name containing the substring txt beginning anywhere except the first letter. Now, this is exactly what *.txt used to do, so in that sense it is equivalent, but it probably isn't what you wanted. The pattern argument to list.files isn't a Windows wildcard expression. It never has been a Windows wildcard expression. It just so happens that ".txt" is also a valid regular expression, but one that means something different from the Windows wildcard expression "*.txt". -thomas