Changeset 317 for trunk/gsdl/perllib/plugins/RecPlug.pm
- Timestamp:
- 1999-06-30T15:36:35+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/RecPlug.pm
r136 r317 27 27 } 28 28 29 # return 1 if processed, 0 if not processed 29 30 # return number of files processed, undef if can't process 30 31 # Note that $base_dir might be "" and that $file might 31 32 # include directories 32 33 sub read { 33 34 my $self = shift (@_); 34 my ($pluginfo, $base_dir, $file, $metadata, $processor) = @_; 35 35 my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs) = @_; 36 36 37 37 my (@dir, $subfile); 38 39 my $count = 0; 38 40 39 41 # see if this is a directory … … 47 49 closedir (DIR); 48 50 51 print STDERR "RecPlug: getting directory $dirname\n"; 52 49 53 # process each file 50 54 foreach $subfile (@dir) { 55 last if (defined $maxdocs && $maxdocs =~ /\d/ && $count >= $maxdocs); 56 51 57 if ($subfile !~ /^\.\.?$/) { 52 58 # note: metadata is not carried on to the next level 53 &plugin::read ($pluginfo, $base_dir, &util::filename_cat($file, $subfile),54 {}, $processor);59 $count += &plugin::read ($pluginfo, $base_dir, &util::filename_cat($file, $subfile), 60 {}, $processor, $maxdocs); 55 61 } 56 62 } 57 58 return 1; 63 return $count; 59 64 } 60 65 61 66 # wasn't a directory, someone else will have to process it 62 return 0;67 return undef; 63 68 } 64 69
Note:
See TracChangeset
for help on using the changeset viewer.