<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1000984" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1000984</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/collecting-list-directories#comment-1004171</link>
    <description> &lt;p&gt;Although File::Find would work perfectly in this case, I offer my own solution.  It is a recursive approach:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;code:&lt;/p&gt;
&lt;pre&gt;
@dirs = ();
populate($start);

sub populate {
  my $dir = shift;
  push @dirs, $dir;
  local (*DIR,$_);
  opendir DIR, $dir or warn(&quot;can&#039;t open $dir: $!&quot;), return;
  while (defined($_ = readdir DIR)) {
    populate(&quot;$dir/$_&quot;) if !/^\.\.?$/ and -d &quot;$dir/$_&quot;;
  }
  closedir DIR;
}
[/code]

------------------
-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve &lt;/pre&gt;&lt;/blockquote&gt;</description>
     <pubDate>Thu, 24 Feb 2000 02:28:00 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1004171 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/collecting-list-directories#comment-1004170</link>
    <description> &lt;p&gt;I prefer the unix way, &#039;find / -type d &amp;gt; directories&#039;.  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/wink.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 Feb 2000 19:56:00 +0000</pubDate>
 <dc:creator>roBofh</dc:creator>
 <guid isPermaLink="false">comment 1004170 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/collecting-list-directories#comment-1004169</link>
    <description> &lt;p&gt;ok, heres my final code if anyone is interested, works like a charm.&lt;/p&gt;
&lt;p&gt;#####################################&lt;/p&gt;
&lt;p&gt;@dirs[0] = &#039;c:/&#039;;&lt;/p&gt;
&lt;p&gt;open(OUTFILE, &quot;&amp;gt;data.txt&quot;);&lt;/p&gt;
&lt;p&gt;foreach(@dirs)&lt;br /&gt;
{	opendir(DIR, $_);&lt;br /&gt;
	@temp = readdir(DIR);&lt;br /&gt;
	foreach $file(@temp)&lt;br /&gt;
	{	$file = $_ . $file . &#039;/&#039;;&lt;br /&gt;
		if(-d $file &amp;amp;&amp;amp; $file !~ /\.\/$/)&lt;br /&gt;
		{	push(@dirs, $file) if -d $file;&lt;br /&gt;
			print OUTFILE &quot;$file\n&quot;;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	close(DIR);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;close(OUTFILE);&lt;/p&gt;
&lt;p&gt;##########################################&lt;/p&gt;
&lt;p&gt;thanks for all the help!&lt;/p&gt;
&lt;p&gt;jk &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 Feb 2000 18:12:00 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1004169 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/collecting-list-directories#comment-1004168</link>
    <description> &lt;p&gt;ok, got it, readdir returns the file name, not the file path thats why the filetests always returned false.&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 Feb 2000 05:48:00 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1004168 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/collecting-list-directories#comment-1004167</link>
    <description> &lt;p&gt;ok, one of my problems is the filetest operator is not working correctly.&lt;/p&gt;
&lt;p&gt;@dirs = &#039;c:/&#039;;&lt;/p&gt;
&lt;p&gt;              foreach(@dirs)&lt;br /&gt;
              { opendir(DIR, $_);&lt;br /&gt;
              @temp = readdir(DIR);&lt;br /&gt;
              foreach $file(@temp)&lt;br /&gt;
              { push(@dirs, $file) if -d $file; }&lt;br /&gt;
              close(DIR);&lt;br /&gt;
              }&lt;/p&gt;
&lt;p&gt;# push(@dirs, $file) if -d $file always returns false&lt;br /&gt;
# do file test operators now work on windows systems?  if i change it to push(@dirs, $file) it works, but gives me all files and not just directories&lt;br /&gt;
push(@dirs, $file) if -e $file; should give me everything too, but gives me nothing.&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 Feb 2000 05:42:00 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1004167 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
