Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > listdir() with mask

Reply
Thread Tools

listdir() with mask

 
 
Vladimir Rusinov
Guest
Posts: n/a
 
      12-14-2007
Hello!

Is there any easy way to list files using bash-like patterns? Something like
listfiles("/var/log/*.log"), listfiles("/var/{cache,run}/*").

Also, I'll need something like listfiles("/tmp/**/*.tmp"), where ** is
unlimited number of folders (like is zsh).

Thanks and sorry for my English.

--
Vladimir Rusinov
GreenMice Solutions: IT-решения на базе Linux
http://greenmice.info/
 
Reply With Quote
 
 
 
 
Rick Dooling
Guest
Posts: n/a
 
      12-14-2007
On Dec 14, 1:56 am, "Vladimir Rusinov" <(E-Mail Removed)>
wrote:

glob or fnmatch

http://docs.python.org/lib/module-glob.html

rd
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion mask in hex to bit mask Marcin Tyman Ruby 4 05-06-2008 08:15 PM
[networking] Convert subnet mask <=> mask length 187 Perl Misc 2 07-29-2004 10:31 AM
how can I route based on src IP address/mask ? Rick Cisco 6 12-26-2003 07:43 PM
How do I set my subnet mask for this range?? batmon Cisco 5 12-20-2003 12:32 PM
Subnet Mask Help Ste Cisco 16 11-03-2003 05:00 PM



Advertisments