Re: List of directories within a directory
- From: Uri Guttman <uri@xxxxxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 04:22:12 GMT
"AM" == Al Moodie <nospam@xxxxxxxxxx> writes:
AM> On Wed, 30 Jan 2008 02:30:16 GMT, "John W. Krahn"
AM> <someone@xxxxxxxxxxx> wrote:
>> Al Moodie wrote:
>>> I have a directory with 200 sub directories in it. How do I create a
>>> list of the sub directory names?
>>>
>>> but how do I do it for the directories within a directory
>>
>> my @dir_names = grep -d "$dirname/$_", readdir DIR;
AM> That is what I need. I want to go into each sub directory in turn and
AM> delete specific files.
then you should use File::Find or one of the variants. scanning dirs
deeply by yourself has all sorts of little bugs waiting to happen.
uri
--
Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
.
- References:
- List of directories within a directory
- From: Al Moodie
- Re: List of directories within a directory
- From: John W. Krahn
- Re: List of directories within a directory
- From: Al Moodie
- List of directories within a directory
- Prev by Date: Re: List of directories within a directory
- Next by Date: Re: List of directories within a directory
- Previous by thread: Re: List of directories within a directory
- Next by thread: Re: List of directories within a directory
- Index(es):
Relevant Pages
|