[Rd] Question about Unix file paths

Duncan Murdoch dmurdoch at pair.com
Tue Nov 25 02:20:03 MET 2003

>Duncan Murdoch <dmurdoch at pair.com> writes:
>> Gabor Grothendieck pointed out a bug to me in list.files(...,
>> full.name=TRUE), that essentially comes down to the fact that in
>> Windows it's not always valid to add a path separator (slash or
>> backslash) between a path specifier and a filename.  For example,
>> c:foo
>> is different from
>> c:\foo
>> and there are other examples.

I've committed a change to r-patched to fix this in Windows only.
Sounds like it's not an issue elsewhere.

Gabor also suggested an option to use shell globbing instead of
regular expressions to select the files in the list, e.g.

list.files(dir="/", pattern="a*.dat", glob=T)

This would be easy to do in Windows, but from the little I know about
Unix programming, would not be so easy there, so I haven't done
anything about it.

Duncan Murdoch

More information about the R-devel mailing list