Leser: 3
4 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
35
36
37
38
39
40
my $path = ".";
&scan_files($path);
print "\n";
exit(0);
sub scan_files
{
my (@scandirs,$scandir,@files,$file,$list);
$scandir = $_[0];
opendir(DIR,$scandir) || warn "can't open the directory $scandir: $!\n";
@scandirs = grep {!(/^\./) && -d "$scandir/$_"} readdir(DIR);
rewinddir(DIR);
@files=grep {!(/^\./) && -f "$scandir/$_" && (/\.log$/)} readdir(DIR);
closedir (DIR);
for $list(0..$#scandirs){
&scan_files($scandir."/".$scandirs[$list]);
}
if ($#files > 0){
foreach $file(@files){
print "$file\n";
}
}
return 1;
}
1
2
3
4
5
# find all the .pm files in @INC
my @files = File::Find::Rule->file()
->name( '*.log' )
->maydepth(1)
->in( @my_dirs );
4 Einträge, 1 Seite |