view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/AgainstFile/CacheModule.pm view on Meta::CPAN
#Are we within the grace period since our last stat?
unless($grace > time - $last_checked)
{
TRACE("stat: $filename");
$data = undef if((stat($filename))[9] > $last_modified); #stat and maybe mark as stale
$self->{'stat'}{$filename} = time;
}
}
}
unless(defined $data)
{
TRACE("stale: $filename");
$data = $self->{loader}->($filename, @opts);
$last_modified = (stat($filename))[9];
$self->_set($filename, [$last_modified, $data]);
}
else
{
TRACE("not stale: $filename");
view all matches for this distribution
view release on metacpan or search on metacpan
map { $c2->set($_, $_ * rand(int(20))) } (1 .. 12345);
my $h = $c2->get_bulk();
is(scalar(keys %$h), $c2->count);
# and see how big the file is
my $size_before = (stat(join('/', $options{cache_root},
'Cache::BDB::02.db')))[7];
my $count_before = $c2->count();
# clear it out
is($c2->clear(), $count_before);
# and check again.
my $size_after = (stat(join('/', $options{cache_root},
'Cache::BDB::02.db')))[7];
ok($size_before > $size_after);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/FileBackend.pm view on Meta::CPAN
-e $p_path or
return undef;
my ( $file_access_time, $file_modified_time ) =
( stat( _Untaint_Path( $p_path ) ) )[8,9];
my $data_ref = _Read_File( $p_path );
utime( $file_access_time, $file_modified_time, _Untaint_Path( $p_path ) );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/CacheFactory/Expiry/LastModified.pm view on Meta::CPAN
return( 1 ) unless $dependencies and $#{$dependencies} > -1;
foreach my $file ( @{$dependencies} )
{
# TODO: options to cache the stat() calls.
return( 0 ) unless -e $file and (stat( $file ))[ 9 ] < $timecreated;
}
return( 1 );
}
lib/Cache/CacheFactory/Expiry/LastModified.pm view on Meta::CPAN
This marks the cache entry as depending on the provided filenames,
if any of these files are modified after the cache entry is created
the entry is considered invalid or is eligible for pruning.
This is done by comparing the last-modified time (as read via C<stat()>)
to the C<created_at> value for the cache entry, this will normally
be reliable but be aware that some programs (tar for example) will
falsify last-modified times, and it's also possible to manipulate
the C<created_at> time of a cache entry when first storing it.
lib/Cache/CacheFactory/Expiry/LastModified.pm view on Meta::CPAN
=head1 KNOWN ISSUES AND BUGS
=over
=item C<stat()> is expensive
Calling C<stat()> on a lot of files is quite expensive, especially
if you're doing it repeatedly. There really ought to be a mechanism
to say that you want to cache the results for a period. Ah, if only
someone had written a handy caching module...
This will probably make it into a future release.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
note( 'umask returns undef on this system, test results may not be reliable')
unless defined $old_umask;
my $FC = Cache::FastMmap->new(init_file => 1);
ok( defined $FC );
my (undef, undef, $Mode) = stat($FC->{share_file});
$Mode = $Mode & 0777;
is($Mode, 0640, "default persmissions 0640");
undef $FC;
my $FC = Cache::FastMmap->new(init_file => 1, permissions => 0600);
ok( defined $FC );
my (undef, undef, $Mode) = stat($FC->{share_file});
$Mode = $Mode & 0777;
is($Mode, 0600, "can set to 0600");
undef $FC;
my $FC = Cache::FastMmap->new(init_file => 1, permissions => 0666);
ok( defined $FC );
my (undef, undef, $Mode) = stat($FC->{share_file});
$Mode = $Mode & 0777;
is($Mode, 0666, "can set to 0666");
undef $FC;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/RamDisk.pm view on Meta::CPAN
use CGI qw(:html);
use Cache::RamDisk::Functions;
[...]
my $s = cache_status ('/tmp/rd');
[...]
print "Number of items for 'fie': ".$s->key_stat('fie'), br;
On application shutdown:
cache_remove ('/tmp/rd');
lib/Cache/RamDisk.pm view on Meta::CPAN
$idx ||= "";
$idx =~ s/(\d+\/\/$id)\n//s if $idx; # "splice" ...
$rdpath = $1 || "";
# remove an existing item (items are stored as a whole on one disk and not broken up, and as we
# secondly have to stat() an existing item anyway in order to compare the sizes, and after this
# comparison maybe ++have++ to delete the old item, we just remove it right here):
if ($rdpath) {
$rdpath =~ s/\/\//\/$k\//;
$rdpath = $self->{Base}.$rdpath;
$key[1]--;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Repository.pm view on Meta::CPAN
target => readlink($fullname),
) or return 0;
}
else
{
my $s = File::stat::stat($fullname);
my $fh = IO::File->new($fullname, 'r') or do {
warn "Can't open $fullname: $!";
return 0;
};
binmode $fh;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/cache-static-cleanup.pl view on Meta::CPAN
foreach my $f (map { "$dir/$_" } grep(!/(\.|\.\.)/, readdir(DIR))) {
if(-f $f) {
#don't delete files named config or log* (log, log.1.gz, etc.)
#note: config files can be 0 or 1 levels down dir tree
next if ($f eq 'config' || $f =~ /^log/);
my @t = stat($f);
my $modtime = @t ? $t[9] : $MAX_TIME;
if($modtime < ($NOW - $THRESH)) {
my $file = $f;
$file =~ s/^$ROOT//;
my $size = $t[7];
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
Datum/Strip.pm view on Meta::CPAN
close OLD;
return;
}
if ($file ne '-' && $fnew ne '-') {
my $mode = (stat(OLD))[2] & 07777;
chmod $mode, $fnew or logwarn "can't propagate mode %04o on $fnew: $!";
}
unless (close NEW) {
logerr "can't flush $fnew: $!";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Carrot/Continuity/Coordination/Episode/Paragraph/TCP_Socket_IO/Buffer/Output.pm view on Meta::CPAN
{
my ($this) = @ARGUMENTS;
return(FLOW_STOP) if ($this->[ATR_STATE] == BST_CLOSED);
my $l = (stat($_[SPX_DATA]))[7];
return(FLOW_NOCHANGE) if ($l == 0);
push(@{$this->[ATR_CHUNKS]}, [$_[SPX_DATA], 0, $l, 1]);
$this->[ATR_SIZE] += $l;
return($this->update);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution