473,232 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,232 software developers and data experts.

How To Read a List of subdirectories in a Directory

Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.
Oct 3 '07 #1
10 11157
numberwhun
3,509 Expert Mod 2GB
Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.
You will want to take a look at the File::Util module on CPAN. There is a function for "list-dir" that has an option to it to only list directories in a directory.

Regards,

Jeff
Oct 3 '07 #2
KevinADC
4,059 Expert 2GB
Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.

post the code you are using.
Oct 3 '07 #3
This is the code I am using.

I have also tried File-Util. But this is not available for windows when searching by ppm.

I tried to compile it using nmake but their are lot of errors.

This is the code i am using to find file list.

@files = <*>;
foreach $file (@files)
{
$counter = $counter += 1;
print $counter." = ".$file . "\n";
}
.
Oct 4 '07 #4
You will want to take a look at the File::Util module on CPAN. There is a function for "list-dir" that has an option to it to only list directories in a directory.

Regards,

Jeff
I have tried but this module is not available by windows when search by ppm.

I tried to compile it using nmake but it says lot of errors and stop.
Oct 4 '07 #5
KevinADC
4,059 Expert 2GB
This is the code I am using.

I have also tried File-Util. But this is not available for windows when searching by ppm.

I tried to compile it using nmake but their are lot of errors.
That looks like it should give you a list of all files and folders in the current directory.
Oct 4 '07 #6
numberwhun
3,509 Expert Mod 2GB
This is the code I am using.

I have also tried File-Util. But this is not available for windows when searching by ppm.

I tried to compile it using nmake but their are lot of errors.
I hate to break it to you, but I am also using Active State on Windows and File-Util IS on there and it is available. It may be that it is already installed by default, you need to check.

Regards,

Jeff
Oct 4 '07 #7
KevinADC
4,059 Expert 2GB
File::Util does not comes as a standard activestate perl module. You must have installed it.
Oct 4 '07 #8
numberwhun
3,509 Expert Mod 2GB
File::Util does not comes as a standard activestate perl module. You must have installed it.
I agree (after looking at a new installation on another machine), but, the fact does remain that it is definitely part of the PPM repository on Active State and is called "File-Util".
Oct 5 '07 #9
KevinADC
4,059 Expert 2GB
I don't see it listed on activestate in the perl module list.

The list goes:

File-Touch
Fle-VirtualPath


which skips any File-U* modules.
Oct 5 '07 #10
numberwhun
3,509 Expert Mod 2GB
I don't see it listed on activestate in the perl module list.

The list goes:

File-Touch
Fle-VirtualPath


which skips any File-U* modules.
Wow, where did you get your list from. You missed a few modules.

PM me your email address and I will send you a screen print of my PPM.
Oct 5 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Thieum22 | last post by:
Hi, I try to go through a directory and it's subdirectories to reah the properties of each files. But I have a problem to set active the directory where the files are, in order to display their...
2
by: Arjen | last post by:
Hello, I want to make a command line application that search for *.htm* files inside directories and subdirectories. 1. How can I save all the *.htm* files inside directories and...
8
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
2
by: melo | last post by:
Hello, I've been struggling with a function(s) to recursively set all folders and files to NOT read-only. So, I thought I'd post this message. What I need to do is: given a starting path, I...
1
by: Benton | last post by:
Hi there, I want to have an unrestricted root directory and some protected subdirectories on my ASP.NET 2.0 application. I want each subdirectory to have its own Login.aspx page. The...
2
by: kamalak | last post by:
hi, can someone help me in writing code in C# for getting the no of files in a directory and all its subdirectories and their subdirectories where the no of subdirectories and their...
9
by: smoothoperator12 | last post by:
Hi all, I have spent hours trying to figure out where I have went wrong with my code for my recursive function to list all the files in a directory, and all of the files in all of its...
9
by: kkhan5000 | last post by:
Hello, I am new to PHP and have put together the following code just by copying other examples from the web. Now I am stuck and would like to sort and display files alphabetically, and also filter...
10
by: beary | last post by:
Hello all, I've done something a bit stupid and am hoping some kind soul out there can help me out. There's a piece of code that goes through and creates a high number of subdirectories within...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.