[Rd] Question about Unix file paths

Duncan Murdoch dmurdoch at pair.com
Wed Nov 26 16:44:35 MET 2003


On Wed, 26 Nov 2003 10:05:42 +0100, Kurt Hornik
<Kurt.Hornik at wu-wien.ac.at> wrote :

>>>>>> Prof Brian Ripley writes:
>
>> On Mon, 24 Nov 2003, Duncan Murdoch wrote:
>>> >Duncan Murdoch <dmurdoch at pair.com> writes:

>>> 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.
>
>> It would be shell-dependent and OS-dependent 

Yes, which makes me think it should be part of file.choose() or
choose.files()  (which interact with the user) rather than
list.files(), if it gets implemented at all.  choose.files() already
has this capability, but as far as I know it currently exists only in
Windows.

>>as well as a retrograde
>> step, as those who wanted to use regular expressions no longer would
>> be able to.

I think the proposal was to add another parameter to list.files to
choose the method of wildcarding, so it wouldn't lose anything.

>Right.  In any case, an explicit glob() function seems preferable to
>me ...

We already have list.files() and dir() with exactly the same meaning,
and the closely related choose.files() and file.choose() for user
interaction.    I don't think we want yet another name for something
that's basically the same task.

Duncan Murdoch



More information about the R-devel mailing list