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
lib/CTK/Plugin/SFTP.pm view on Meta::CPAN
}
}
# Get file size if put is success
if ($statput == 1) {
if (my $rstat = $sftp->stat($name)) {
$fs_remote = $rstat->size || 0;
} else {
$self->error(sprintf("The stat() failed: %s", $sftp->error)) if $sftp->error;
}
}
# Remove file
if ($fs_remote == $fs_local) { # Ok
view all matches for this distribution
view release on metacpan or search on metacpan
gen/perl_callout.c view on Meta::CPAN
EXTERN_C int zread (int fd, ZARRAYP a);
EXTERN_C int zclose (int fd, ZARRAYP ret);
EXTERN_C int zsetkey (int fd, ZARRAYP p);
EXTERN_C int zerror (int i, int j);
EXTERN_C int zfilecheck (const char *p, ZARRAYP ret);
EXTERN_C int zstat(const char *p, int *ret);
EXTERN_C int zunlink(const char *p, int *ret);
EXTERN_C int zrmdir(const char *p, int *ret);
EXTERN_C int zmkdir(const char *p, int *ret);
EXTERN_C int zrename(const char *old, const char *neu, int *ret);
EXTERN_C int zreaddir(const char *dirname, ZARRAYP out);
gen/perl_callout.c view on Meta::CPAN
out->len = p - out->data;
return 0;
}
#endif
int zstat(const char *p, int *ret)
{
struct stat b;
int rc;
int x = 0;
rc = stat(p, &b);
if(!rc) {
if(S_ISLNK(b.st_mode))
x = 'L';
if(S_ISREG(b.st_mode))
x = 'F';
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
# 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
- mmc_lock: fix off-by-one allowing page == c_num_pages
(one past the last valid page).
- mmc_lock: replace hardcoded num_slots >= 89 sanity check
with cache->start_slots, so caches built with custom
start_slots values lock correctly.
- mmc_check_fh: check fstat() return value before trusting
statbuf.st_ino, restoring the safety net the function
was added for.
- mmc_iterate_next: end iteration cleanly if mmc_lock fails
instead of walking stale page state.
- Win32 mmc_unlock_page: split p_offset into Offset and
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/Devel/CheckOS.pm view on Meta::CPAN
$re_AssertOS = qr/$case_flag ^AssertOS$/x;
}
# sort by mtime, so oldest last
my @modules = sort {
(stat($a->{file}))[9] <=> (stat($b->{file}))[9]
} map {
my (undef, $dir_part, $file_part) = File::Spec->splitpath($_);
$file_part =~ s/\.pm$//;
my (@dirs) = grep {+length} File::Spec->splitdir($dir_part);
foreach my $i (reverse 1..$#dirs) {
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