File-Find-Repository
view release on metacpan or search on metacpan
lib/File/Find/Repository.pm view on Meta::CPAN
sub FIRST_FOUND
{
=head2 FIRST_FOUND
Returns the first matching file.
=cut
my ($object, $located_files) = @_ ;
my (@keys) = keys %{$located_files} ;
return($located_files->{$keys[0]}) ;
}
#-------------------------------------------------------------------------------
sub TIME_AND_SIZE
{
=head2 TIME_AND_SIZE
Adds time and size information to the matched file.
=cut
my ($object, $file_name, $file) = @_ ;
Readonly my $YEAR_1900 => 1900 ;
Readonly my $STAT_SIZE => 7 ;
Readonly my $STAT_CTIME => 10 ;
if($file->{EXISTS})
{
my ($file_size, undef, undef, $modification_time) = (stat($file->{FOUND_AT}))[$STAT_SIZE..$STAT_CTIME];
my ($sec, $min, $hour, $month_day, $month, $year, $week_day, $year_day) = gmtime($modification_time) ;
$year += $YEAR_1900 ;
$month++ ;
$file->{SIZE} = $file_size ;
$file->{DATE} =
{
DAY => $month_day,
MONTH => $month,
YEAR => $year,
HOUR => $hour,
MINUTE => $min,
SECOND => $sec,
};
}
return(1) ;
}
#-------------------------------------------------------------------------------
1 ;
=head1 BUGS AND LIMITATIONS
None so far.
=head1 AUTHOR
Khemir Nadim ibn Hamouda
CPAN ID: NKH
mailto:nadim@khemir.net
=head1 LICENSE AND COPYRIGHT
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc File::Find::Repository
You can also look for information at:
=over 4
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/File-Find-Repository>
=item * RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-file-find-repository@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on
your bug as we make changes.
=item * Search CPAN
L<http://search.cpan.org/dist/File-Find-Repository>
=back
=head1 SEE ALSO
L<File::Find::Rules>
=cut
( run in 0.598 second using v1.01-cache-2.11-cpan-39bf76dae61 )