Commits

Herbert Breunung  committed 8371741 Merge

need a search prototype

  • Participants
  • Parent commits d5ac0a7, a977606
  • Branches sp1

Comments (0)

Files changed (2)

File lib/findlib.pl

 FindKephraLib->new->MainLoop;
 
 package FindKephraLib;
+use Cwd qw(abs_path);
 use File::Find;
 use File::Spec;
 use FindBin qw($RealBin);
 	my $app   = shift;
 	my $frame = Wx::Frame->new( undef, -1, __PACKAGE__ , [-1,-1], [1000,800]);
 	my $ed = Wx::TextCtrl->new($frame, -1, '',[-1,-1], [-1,-1], &Wx::wxTE_MULTILINE | &Wx::wxTE_READONLY);
-	find({ wanted => sub {
-		if (-f $_ and substr($_, -9) eq 'Kephra.pm') {
-		 	my $path = File::Spec->catdir( $RealBin, $File::Find::name );
-		 	$path = File::Spec->canonpath( $path );
-			$ed->AppendText( $path . "\n")
-		}
-	}, follow => 0, no_chdir => 1 }, '../../..');
+	find({ preprocess => sub {
+			grep {1 unless -d $_
+			} 
+			@_;
+		}, 
+		wanted => sub {
+			if (-f $_ and substr($_, -9) eq 'Kephra.pm') {
+				#$File::Find::dir #$File::Find::name # $_
+		 		my $path = File::Spec->catdir( $RealBin, $File::Find::name );
+		 		$path = File::Spec->canonpath( $path );
+		 		$path = abs_path( $path );
+				$ed->AppendText( $File::Find::name . "\n");
+			}
+			#$ed->AppendText( $_ . "\n")
+	}, follow => 0, no_chdir => 1 }, '/Users/lichtkind');
 
-
-#$File::Find::dir
-#$File::Find::name # $_
 	$frame->Show(1);
 	$app->SetTopWindow($frame);
 	1;

File lib/searched.pl

Empty file added.