2023-02-26 00:25:43
This commit is contained in:
29
src/walker.pl
Executable file
29
src/walker.pl
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use Cwd;
|
||||
|
||||
sub walk {
|
||||
my ($workdir) = shift;
|
||||
my ($startdir) = &cwd; # keep track of where we began
|
||||
|
||||
chdir($workdir) or die "Unable to enter dir $workdir:$!\n";
|
||||
opendir(DIR, ".") or die "Unable to open $workdir:$!\n";
|
||||
my @names = readdir(DIR) or die "Unable to read $workdir:$!\n";
|
||||
closedir(DIR);
|
||||
|
||||
foreach my $name (@names){
|
||||
next if ($name eq ".");
|
||||
next if ($name eq "..");
|
||||
if (-d $name){ # is this a directory?
|
||||
&walk($name);
|
||||
next;
|
||||
}
|
||||
if ($name eq "build.gradle.kts") {
|
||||
# is this a file named "core"?
|
||||
print "found : $workdir/$name\n";
|
||||
}
|
||||
chdir($startdir) or die "Unable to change to dir $startdir:$!\n";
|
||||
}
|
||||
}
|
||||
|
||||
&walk("/media/elex/UltraFit/Workspace/ELEX");
|
||||
Reference in New Issue
Block a user