This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author george.hu
Recipients eric.smith, george.hu, l0nwlf
Date 2010-04-15.01:40:19
SpamBayes Score 2.903191e-08
Marked as misclassified No
Message-id <s2i3c0ab30d1004141840w882783d5x8794c5a9261fd436@mail.gmail.com>
In-reply-to <1271295276.54.0.998986003184.issue8402@psf.upfronthosting.co.za>
Content
Well, the listdir doesn't support "wildcard", for example,
listdir("*.app"). I know the glob is kind of unix shell style expanding, but
my program is running under windows, it's my tiny script to walk through a
huge directory in my NAS. And there are many directories named with "[]" and
"()" characters amid. May the only way is to program a filter on the
listdir.

On Wed, Apr 14, 2010 at 6:34 PM, Shashwat Anand <report@bugs.python.org>wrote:

>
> Shashwat Anand <anand.shashwat@gmail.com> added the comment:
>
> glob module does not provide what you want.
> As a workaround you can try:
>
> os.listdir("c:\abc\afolderwith[test]")
>
> 07:02:52 l0nwlf-MBP:Desktop $ ls -R test\[123\]/
> 1 2 3
> >>> os.listdir('/Users/l0nwlf/Desktop/test[123]')
> ['1', '2', '3']
>
> Changing type to 'Feature Request'
>
> ----------
> status: pending -> open
> type: behavior -> feature request
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue8402>
> _______________________________________
>
Files
File name Uploaded
unnamed george.hu, 2010-04-15.01:40:18
History
Date User Action Args
2010-04-15 01:40:22george.husetrecipients: + george.hu, eric.smith, l0nwlf
2010-04-15 01:40:19george.hulinkissue8402 messages
2010-04-15 01:40:19george.hucreate