1
1
openmpi/contrib/find_occurence.pl
Prabhanjan Kambadur 4257467fec this is the big windows commit. there are more things which have gone into this than i can remember. but basically, we are looking for
1. header file and source file protections using #ifdef WIN32
2. new files and directories to support windows functionality
3. appropritate linkage symbols added (OMPI_DECLSPEC) for windows
4. some functions are unimplemented on the windows side. this is mostly
because there might not be need to implement it in windows land. eg., forking
a daemon off
5. Introduced locking mechanisms for windows

This commit was SVN r3286.
2004-10-22 16:06:05 +00:00

29 строки
596 B
Perl
Исполняемый файл

#!/usr/bin/perl
if (scalar(@ARGV) != 2) {
print "Usage: #find_occurence <string> <source-path>\n";
exit(3);
}
$search_string = @ARGV[0];
$source_path = @ARGV[1];
open (SOURCE_FILES, "find $source_path -name *.c |") || print "could not open the pipe\n";
while (<SOURCE_FILES>) {
#open the file and delete the occurence
$file_name = $_;
open (FILE, "$file_name") || print "Could not open $file_name for reading\n";
while (<FILE>) {
if (/$search_string/) {
print $file_name;
}
}
close(FILE);
}
close(SOURCE_FILES);