Leser: 1
3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
sub MakeList {
$level++;
my ($TreeDir) = @_;
opendir(TREEDIR, $TreeDir) or die "Error: couldn't open directory '$Directory':$!\n";
foreach my $entry3 (readdir(TREEDIR)) {
unless ($entry3 =~ m/\.\.?$/) {
my $i = 0;
#---This prints the directories and subdirectories. The subdirs are indented by tab
print $level;
while ($i < $level) {
print "\t";
$i++;
}
print "$entry3\n";
#---End of that printing thing
if (-d "$TreeDir/$entry3"){
my $NextDir = "$TreeDir/$entry3";
print "\nEntering new Folder $NextDir\n";
MakeList($NextDir);
}
}
}
closedir(TREEDIR);
$level--;
}
print "\t" x $level;
3 Einträge, 1 Seite |