Re: Problem with glob and filenames containing '[' and ']'
- From: David Squire <David.Squire@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 15:30:20 +0100
Michele Dondi wrote:
On Wed, 27 Sep 2006 12:33:26 +0100, David Squire
<David.Squire@xxxxxxxxxxxxxxxxxxxx> wrote:
I'm having trouble using glob to find filenames that contain '[' and
Well I'm a big fan of glob() myself, and I recommend using it
especially when I see people using lower level opendir() & C. in
situations in which it's not strictly necessary, but this may be a
situation in which it may indeed be good to do so.
I've just written a work around to do so :)
']', even though I am escaping those meta-characters. Here is an example
script and output:
However, I don't seem to have that problem:
C:\TEMP>touch foo[bar]
C:\TEMP>touch foo[baz]
C:\TEMP>perl -le "print for glob 'foo\\[*\\]'"
foo[bar]
foo[baz]
Yeah, as you will see from my second post, the critical thing seems to
be the presence of an escaped space as well. Thanks.
DS
.
- References:
- Problem with glob and filenames containing '[' and ']'
- From: David Squire
- Problem with glob and filenames containing '[' and ']'
- Prev by Date: Re: Problem with glob and filenames containing '[' and ']'
- Next by Date: Re: How to initialize class data?
- Previous by thread: Re: Problem with glob and filenames containing '[' and ']'
- Next by thread: Passing object from subroutine problem
- Index(es):
Relevant Pages
|