Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > opendir mydir/??/??/??

Reply
Thread Tools

opendir mydir/??/??/??

 
 
avilella@gmail.com
Guest
Posts: n/a
 
      11-25-2007
Hi all,

I have a group of dirs and subdirs that look like mydir/00/00/00,
mydir/00/00/01 ... mydir 11/55/99.

In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
that I can do an opendir like:

opendir(DIR, "mydir/??/??/??")

Cheers,

Albert.
 
Reply With Quote
 
 
 
 
Spiros Denaxas
Guest
Posts: n/a
 
      11-25-2007
On Nov 25, 8:11 pm, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> Hi all,
>
> I have a group of dirs and subdirs that look like mydir/00/00/00,
> mydir/00/00/01 ... mydir 11/55/99.
>
> In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
> that I can do an opendir like:
>
> opendir(DIR, "mydir/??/??/??")
>
> Cheers,
>
> Albert.


Hi Albert,

use the File::Find module. I think it will give you the flexibility to
do what you want.

http://search.cpan.org/~nwclark/perl...b/File/Find.pm

Good luck,
Spiros
 
Reply With Quote
 
 
 
 
John W. Krahn
Guest
Posts: n/a
 
      11-25-2007
"(E-Mail Removed)" wrote:
>
> I have a group of dirs and subdirs that look like mydir/00/00/00,
> mydir/00/00/01 ... mydir 11/55/99.
>
> In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
> that I can do an opendir like:
>
> opendir(DIR, "mydir/??/??/??")


my @files = glob "mydir/??/??/??/*.ext";

perldoc -f glob
perldoc File::Glob



John
--
use Perl;
program
fulfillment
 
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
Looking for a class similar to 'opendir' and 'readdir' Ramon Java 5 01-03-2005 01:59 PM
opendir doesn't work.. Markus Pitha C Programming 5 09-12-2004 02:40 PM
using "opendir" through a CGI script on Apache Alex Perl 2 02-10-2004 04:35 AM
opendir and if -d $files problem Bob Gervais Perl 1 11-12-2003 05:34 AM
opendir() Andrew Perl 2 09-03-2003 02:48 PM



Advertisments