Hallo,

On Sun, Feb 12, 2023 at 03:48:36PM +0100, Hilmar Preuße wrote:
> my $wanted = sub {
>         my $stat = stat($_);
>         return unless -f $stat;
>         return unless $stat->mtime > $touchstat->mtime;
>         return unless /$filePattern/;
>         push @files, $File::Find::name;
> };
> 
> find($wanted, glob("/var/log/icinga/logs"));

Eine Anmerkung noch. Es ist eventuell effizienter, wenn Du den Check
auf den Filename vor das stat() legst. Ich bin mir nicht 100% sicher,
ob das im konkreten Anwendungsfall wirklich nen Unterschied macht, aber
solche syscalls grad bei Filesystemzeugs sind in Perl tendenziell teuer.
(in C würd ich das definitiv davor legen)

Grüsse
Andreas

Attachment: signature.asc
Description: PGP signature

Antwort per Email an