From dmurdoch at pair.com  Wed Nov 26 16:44:35 2003
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Wed Nov 26 16:43:34 2003
Subject: [Rd] Question about Unix file paths
In-Reply-To: <16324.27878.740145.101@mithrandir.hornik.net>
References: <17b5svs7cl2cjmto222665p545mb0ok74u@4ax.com>
	<Pine.LNX.4.44.0311250728180.26806-100000@gannet.stats>
	<16324.27878.740145.101@mithrandir.hornik.net>
Message-ID: <mod9svcngi8024l2vt0ii9hd7ld8l4fmgq@4ax.com>

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

>>>>>> Prof Brian Ripley writes:
>
>> On Mon, 24 Nov 2003, Duncan Murdoch wrote:
>>> >Duncan Murdoch <dmurdoch@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


[Rd] Question about Unix file paths
Duncan Murdoch