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/CGI/Info.pm view on Meta::CPAN
use CGI::Info;
my $info = CGI::Info->new();
my $fullname = $info->script_path();
my @statb = stat($fullname);
if(@statb) {
my $mtime = localtime $statb[9];
print "Last-Modified: $mtime\n";
# TODO: only for HTTP/1.1 connections
view all matches for this distribution
view release on metacpan or search on metacpan
t/uploads.t view on Meta::CPAN
@files = qw/does_not_exist_gif 100;100_gif 300x300_gif/;
my @sizes = qw/0 896 1656/;
for my $i (0..2) {
my $file = "$uploaddir/$form->{$files[$i]}";
ok (-e $file, "Uploaded file exists ($i)") or warn "Name = '$file'\n" . $cgi->get_error_message;
is ((stat($file))[7], $sizes[$i], "File size check ($i)") or
warn_tail ($file);
}
is ($cgi->set_directory ('/srhslgvsgnlsenhglsgslvngh'), 0,
'Set directory (non-existant)');
t/uploads.t view on Meta::CPAN
for my $i (0..3) {
my $file = "$uploaddir/$form->{$files[$i]}";
ok (-e $file, "Uploaded file exists ($i - buffer size $buf_size") or
warn "Name = '$file'\n" . $cgi->get_error_message;
is ((stat($file))[7], $sizes[$i],
"File size check ($i - buffer size $buf_size)") or
warn_tail ($file);
unlink ($file);
}
}
t/uploads.t view on Meta::CPAN
is ($cgi->is_error, 0,
"Parsing upload data with a large file - buffer size $buf_size");
my $file = "$uploaddir/$form->{plain_txt}";
ok (-e $file, "Uploaded file exists ($file - buffer size $buf_size") or
warn "Name = '$file'\n" . $cgi->get_error_message;
is ((stat($file))[7], $sizes[0],
"File size check ($file - buffer size $buf_size)") or
warn_tail ($file);
unlink ($file);
}
t/uploads.t view on Meta::CPAN
is ($cgi->is_error, 0, 'Parsing upload data with different boundary');
ok (exists $form->{other_file}, 'Parsing of different boundary complete');
my $file = "$uploaddir/$form->{other_file}";
ok (-e $file, "Uploaded file exists for different boundary ($file)") or
warn "Name = '$file'\n" . $cgi->get_error_message;
is ((stat($file))[7], $sizes[0],
"File size check for different boundary ($file)") or
warn_tail ($file);
unlink ($file);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Mungo/Session.pm view on Meta::CPAN
my $expire = (time - 86400);
foreach(@sessions){ #check each of the cookies
my $prefix = $self->_getPrefix();
if($_ =~ m/^($prefix[a-f0-9]+)$/){ #found a cookie file
my $sessionFile = File::Spec->catfile($path, $1);
my @stat = stat($sessionFile);
if(defined($stat[9]) && $stat[9] < $expire){ #cookie is more than a day old, so remove it
unlink $sessionFile;
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
MxScreen.pm view on Meta::CPAN
# scriptright before saving context. That fields can be used to
# check for session validity.
#
$self->ctx->{'time'} = time;
$self->ctx->{'script_date'} = (stat($0))[9];
#
# Cleanup context to avoid saving transient data
#
MxScreen.pm view on Meta::CPAN
#
# check that the script file has not been modified (compare the
# last modification time on the file system)
#
if ($ctx->{'script_date'} != (stat($0))[9]) {
$self->internal_error(<<EOS);
Script file has been modified since the last display,
please restart a new session.
EOS
}
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
CGI/SHTML.pm view on Meta::CPAN
}
## _flastmod( FILE )
## _fsize( FILE )
# Last modification and file size of the given FILE, respectively.
sub _flastmod { localtime( (stat($_[1]))[9] || 0 ); }
sub _fsize {
my $size = ((stat($_[1]))[7]) || 0;
if ($size >= 1048576) {
sprintf("%4.1fMB", $size / 1048576);
} elsif ($size >= 1024) {
sprintf("%4.1fKB", $size / 1024);
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
SSI_Parser.pm view on Meta::CPAN
#
sub ssi_fsize_file {
my $file = shift;
my $size;
$size = (stat("$file"))[7];
if ($sizefmt == $SIZEFMT_KMG) {
if ($size/1048576 >= 1) { # 1024*1024
$size = sprintf("%.1fM", $size/1048576);
} else {
$size = ceil($size/1024) . "k";
SSI_Parser.pm view on Meta::CPAN
#
sub ssi_flastmod_file {
my $file = shift;
my $lastmod;
$lastmod = (stat("$file"))[9];
$lastmod = strftime($timefmt, localtime($lastmod));
print FOUT $lastmod;
}
# Usage: ssi_flastmod_virtual($file);
view all matches for this distribution
view release on metacpan or search on metacpan
SecureState.pm view on Meta::CPAN
$length = unpack("N",substr($block,0,4));
$extra = ($length % 8) ? (8-($length % 8)) : 0;
$decoded=-8;
#sanity check
if ((stat(STATEFILE))[7] != ($length+$extra+8))
{ $self->errormsg('invalid state file') }
#read the rest of the file
sysseek(STATEFILE, 8, $SEEK_SET);
unless (sysread(STATEFILE,$buffer,$length+$extra) == ($length+$extra))
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/CGI/Session/ExpireSessions.pm view on Meta::CPAN
my($file, @stat, $D);
for my $file (@file)
{
@stat = stat($file);
# Delete old, tiny files.
if ( ( ($time - $stat[8]) >= $$self{'_delta'}) && ($stat[7] <= 5) )
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/Driver/file.pm view on Meta::CPAN
$filename_pattern =~ s/\./\\./g;
$filename_pattern =~ s/\%s/(\.\+)/g;
while ( my $filename = readdir(DIRHANDLE) ) {
next if $filename =~ m/^\.\.?$/;
my $full_path = File::Spec->catfile($self->{Directory}, $filename);
my $mode = (stat($full_path))[2]
or return $self->set_error( "traverse(): stat failed for $full_path: " . $! );
next if S_ISDIR($mode);
if ( $filename =~ /^$filename_pattern$/ ) {
$coderef->($1);
}
view all matches for this distribution
view release on metacpan or search on metacpan
speedy_dump/SpeedyFile.pl view on Meta::CPAN
}
sub data { my $self = shift;
if (!$self->{data}) {
open(F, $self->fname) || die $self->fname . ": $!\n";
my $sz = (stat(F))[7];
my $data;
read(F, $data, $sz);
$self->{data} = $data;
close(F);
}
view all matches for this distribution
view release on metacpan or search on metacpan
kSession.pm view on Meta::CPAN
opendir(SD,$cl->{path});
my @files = readdir(SD);
shift @files;
shift @files;
foreach my $f (@files) {
if (((stat($cl->{path}.$f))[9] + $cl->{lifetime}) < time()) {
unlink($cl->{path}.$f);
}
}
closedir(SD);
}
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/CHI/Driver/SharedMem.pm view on Meta::CPAN
if($self->shm_key() && $self->shm()) {
$self->_lock(type => 'write');
my $cur_size = $self->_data_size();
# print $tulip "DEMOLISH: $cur_size bytes\n";
my $can_remove = 0;
my $stat = $self->shm()->stat();
if($cur_size == 0) {
if(defined($stat) && ($stat->nattch() == 1)) {
$self->shm()->detach();
$self->shm()->remove();
$can_remove = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
L<CHI::CacheObject|CHI::CacheObject> and L<CHI::Driver|CHI::Driver> as the
parameters. If code returns a true value, C<get> returns undef as if the item
were expired. For example, to treat the cache as expired if I<$file> has
changed since the value was computed:
$cache->get('foo', expire_if => sub { $_[0]->created_at < (stat($file))[9] });
=item busy_lock [DURATION]
If the value has expired, the get will still return undef, but the expiration
time of the cache entry will be set to the current time plus the specified
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CIPP/Compile/Cache.pm view on Meta::CPAN
chomp $line;
my ($src_file, $cache_file, $err_file);
($src_file, $cache_file, $err_file) = split(/\t/, $line);
my $src_file_mtime = (stat($src_file))[9];
# check for cached error
$DEBUG && print STDERR "err_file=$err_file\n";
my $has_cached_err = 0;
my $err_file_mtime;
if ( -f $err_file ) {
$DEBUG && print STDERR "err-file $err_file OLDER $src_file : ";
$err_file_mtime = (stat($err_file))[9];
if ( $err_file_mtime < $src_file_mtime ) {
# cache is dirty, if err_file is older than src_file
close IN;
$DEBUG && print STDERR "YES\n";
$DEBUG && print STDERR "Status: $dirty\n";
lib/CIPP/Compile/Cache.pm view on Meta::CPAN
return $dirty;
}
$DEBUG && print STDERR "$cache_file OLDER $src_file : ";
my $cache_file_mtime = (stat($cache_file))[9];
if ( -f $cache_file and $cache_file_mtime < $src_file_mtime ) {
# cache is dirty, if cache_file is older than src_file
close IN;
$DEBUG && print STDERR "YES\n";
lib/CIPP/Compile/Cache.pm view on Meta::CPAN
last;
}
# $DEBUG && print STDERR "consistency check: $src_file OLDER $if_file : ";
#
# if ( (stat($src_file))[9] < (stat($if_file))[9] ) {
# $DEBUG && print STDERR "YES!!!\n";
# $DEBUG && print STDERR "removing $if_file, must be regenerated\n";
# unlink $if_file;
# $status = $dirty;
# last;
# }
$DEBUG && print STDERR "$cache_file OLDER $src_file : ";
if ( (stat($cache_file))[9] < (stat($src_file))[9] ) {
# cache is dirty if one cache_file is older
# than corresponding src_file
$status = $dirty;
$DEBUG && print STDERR "YES\n";
last;
lib/CIPP/Compile/Cache.pm view on Meta::CPAN
$DEBUG && print STDERR "NO\n";
if ( $has_cached_err ) {
$DEBUG && print STDERR "$err_file OLDER $if_file (incompat. interface?) : ";
if ( $err_file_mtime < (stat($if_file))[9] ) {
# cache is dirty if the cached error is older than
# the if_file (which indicates incompatible
# interface change)
$DEBUG && print STDERR "YES\n";
$status = $dirty;
lib/CIPP/Compile/Cache.pm view on Meta::CPAN
$DEBUG && print STDERR "NO\n";
}
$DEBUG && print STDERR "$cache_file OLDER $if_file : ";
if ( $cache_file_mtime < (stat($if_file))[9] ) {
# cache is dirty if the cache_file_mtime of
# our object is older than one if_file
$DEBUG && print STDERR "YES\n";
$status = $dirty if not $has_cached_err;
last;
view all matches for this distribution
view release on metacpan or search on metacpan
{
my ($filename) = @_;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
return qq{
Inode\t$ino
Mode\t$mode
UID\t$uid
view all matches for this distribution
view release on metacpan or search on metacpan
return $self->force_read_file;
}
if (! defined $self->{COMMON}->{CONFIG}->{DATA}) {
# no reread required if DATA option was used
@f_stat = stat($self->{COMMON}->{FILENAME});
if ($f_stat[9] > $self->{COMMON}->{LASTREAD}) {
$self->{COMMON}->{LASTCHANGED} =
scalar(localtime($f_stat[9]));
return $self->force_read_file;
$self->{COMMON}->{LASTREAD} = time;
$self->{COMMON}->{FILETIME} = time;
$self->read_file_into_cache();
} elsif ($fh->open($self->{COMMON}->{FILENAME})) {
$self->{COMMON}->{LASTREAD} = time;
@f_stat = stat($fh);
$self->{COMMON}->{FILETIME} = $f_stat[9];
$self->read_file_into_cache($fh);
} else {
push(@{$self->{COMMON}->{GLOBALERROR}}, $!);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CORBA/IDL/Lexer.pm view on Meta::CPAN
}
else {
print "INTERNAL_ERROR:_Lexer\n";
}
if (defined $parser->YYData->{srcname}) {
my @st = stat($parser->YYData->{srcname});
$parser->YYData->{srcname_size} = $st[7];
$parser->YYData->{srcname_mtime} = $st[9];
}
}
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/CPAN.pm view on Meta::CPAN
sub _perl_fingerprint {
my($self,$other_fingerprint) = @_;
my $dll = eval {OS2::DLLname()};
my $mtime_dll = 0;
if (defined $dll) {
$mtime_dll = (-f $dll ? (stat(_))[9] : '-1');
}
my $mtime_perl = (-f CPAN::find_perl ? (stat(_))[9] : '-1');
my $this_fingerprint = {
'$^X' => CPAN::find_perl,
sitearchexp => $Config::Config{sitearchexp},
'mtime_$^X' => $mtime_perl,
'mtime_dll' => $mtime_dll,
};
if ($other_fingerprint) {
if (exists $other_fingerprint->{'stat($^X)'}) { # repair fp from rev. 1.88_57
$other_fingerprint->{'mtime_$^X'} = $other_fingerprint->{'stat($^X)'}[9];
}
# mandatory keys since 1.88_57
for my $key (qw($^X sitearchexp mtime_dll mtime_$^X)) {
return unless $other_fingerprint->{$key} eq $this_fingerprint->{$key};
}
view all matches for this distribution