develooper Front page | perl.beginners | Postings from January 2002

traversing a file tree...one step further

Thread Next
From:
Ben Crane
Date:
January 10, 2002 05:39
Subject:
traversing a file tree...one step further
Message ID:
20020110133932.20879.qmail@web14506.mail.yahoo.com
Hi list,

I have got a program running that opens a text file,
finds file names within the txt file and then runs a
file::find to determine the location of these files
(within the same directory). My next question is: If i
want to write a list of all the files within more than
one directory how do I do it.

I have the initial start directory, it locates all the
files within it and prints them out. but within the
directory are more subdirectories...what I want is to
produce a list of every file within the main directory
and the sub directories.

why? the files in these directories change on a
constant basis and I want a txt file (updated every
day) to determine what's there and what isn't...its
part of our corporate website and simple file
management is becoming very hard.

I was thinking of using file::depth but am not
entirely sure if it's the right solution. My next idea
was to put a list of sub directories in an array and
then loop through the array opening each respective
sub direc and printing the files within...at the
moment my text file returns a set of files within the
directory and a list of sub directories...if this
method is simple, how do I dump info into an array for
later use (the array will have data added to it whilst
inside a foreach(..) loop...

Any/all help would be appreciated.


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About