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/Application/Plugin/Stream.pm view on Meta::CPAN
sub stream_file {
my ( $self, $file_or_fh, $bytes ) = @_;
$bytes ||= 1024;
my ($fh, $basename);
my $size = (stat( $file_or_fh ))[7];
# If we have a file path
if ( ref( \$file_or_fh ) eq 'SCALAR' ) {
# They passed along a scalar, pointing to the path of the file
# So we need to open the file
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Search.pm view on Meta::CPAN
return [];
}
# if we are going to use the cache (meaning we want to use
# it and there's up-to-date data in there)
my $file_mod_time = (stat($file))[9];
if ( $want_to_cache
and @SUGGEST_CACHE
and $SUGGEST_CACHE_TIME >= $file_mod_time)
{
foreach my $cached (@SUGGEST_CACHE) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Util/Diff.pm view on Meta::CPAN
my($stat);
for my $file_name (@file_name)
{
$name = file($dir_name, $file_name);
$stat = stat($name);
$file_name{$file_name} =
{
mtime => scalar localtime($stat -> mtime() ),
size => $stat -> size(),
type => -d $name ? 'Dir' : 'File',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Buffer.pm view on Meta::CPAN
unless(defined($path)) {
croak 'Failed to retrieve script path';
return;
}
my @statb = stat($path);
$script_mtime = $statb[9]; # Set script_mtime to the modification time of the script
return $script_mtime;
}
sub _should_gzip
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Bus/fut.pm view on Meta::CPAN
$sub =$dir; next
}
my $fs;
foreach my $elem ($s->glob($dir)) {
$_ =$elem;
my @stat =stat($elem);
my @nme =(/^(.*)[\/\\]([^\/\\]+)$/ ? ($1,$2) : ('',''));
if (@stat ==0 && ($opt =~/[^!]*i/i || ($^O eq 'MSWin32' && $elem =~/[\?]/i))) {next} # bug in stat!
elsif (@stat ==0) {die("stat('$elem'): $!\n"); undef($_); return(0)}
elsif ($stat[2] & 0120000 && $opt =~/!.*s/i) {next} # symlink
elsif (!defined($fs)) {$fs =$stat[2]}
elsif ($fs !=$stat[2] && $opt =~/!.*m/i) {next} # mountpoint?
if ($stat[2] & 0040000 && $opt =~/!.*l/i) { # finddepth
$ret +=$s->find($opt, "$elem/*", $sub); defined($_) || return(0);
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
sub set_defaults
{
my $module_name = $Module;
$module_name =~ s/::/-/g;
my $uid = (stat( $0 ))[4];
my $user = getpwuid($uid);
### Control to
#
my %default_to = (
view all matches for this distribution
view release on metacpan or search on metacpan
examples/p5httpd view on Meta::CPAN
my ( $file, $mimetype, $method ) = @_;
$method = "GET" unless $method;
my $fullpath = "$server_root$file";
my ( undef, undef, undef, undef, undef, undef, undef, $length, undef, $mtime )
= stat($fullpath);
$mtime = gmtime $mtime;
my ( $day, $mon, $dm, $tm, $yr ) =
( $mtime =~ m/(...) (...) (..) (..:..:..) (....)/ );
print Client "Content-length: $length\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/FileManager.pm view on Meta::CPAN
push @files, {
filename => $f,
filetype => $self->_file_type($full),
subdir => -d $full,
zipfile => ($full =~ /\.zip/i ? 1 : 0),
filedate => scalar (localtime((stat($full))[9])),
size => (stat($full))[7],
delete_link => $f eq ".." ? "" : $self->_delete_link($full),
rename_link => $f eq ".." ? "" : $self->_rename_link($full),
workdir => $workdir,
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
cgi/cgi-fileupload-manager.pl view on Meta::CPAN
foreach(@fus){
next unless $isAdmin || ($_->from_id() eq $id);
my $status=$_->upload_status();
print " <tr>\n";
print " <td>".$_->file_orig()."</td>\n";
print " <td>".(ctime((stat($_->file('.properties')))[9]))."</td>\n";
print " <td>$status</td>\n";
print " <td>".(($status eq 'completed')?(-s $_->file()):'n/a')."</td>\n";
print " <td>".$_->from_ipaddr()."</td>\n";
print " <td>".$_->from_id()."</td>\n" if $isAdmin;
print " <td align='center'><input type='checkbox' name='key' value='".$_->key()."'/></td></tr>\n";
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/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
scripts/generate_index.pl view on Meta::CPAN
$total_pct
);
}
my $timestamp = 'Unknown';
if (my $stat = stat($cover_db)) {
$timestamp = strftime('%Y-%m-%d %H:%M:%S', localtime($stat->mtime));
}
Readonly my $commit_url => "https://github.com/nigelhorne/CGI-Lingua/commit/$commit_sha";
my $short_sha = substr($commit_sha, 0, 7);
scripts/generate_index.pl view on Meta::CPAN
next unless $json && $json->{summary}{Total};
my ($sha) = $file =~ /-(\w{7})\.json$/;
next unless $commit_messages{$sha}; # Skip merge commits
my $timestamp = $commit_times{$sha} // strftime('%Y-%m-%dT%H:%M:%S', localtime((stat($file))->mtime));
$timestamp =~ s/ /T/;
$timestamp =~ s/\s+([+-]\d{2}):?(\d{2})$/$1:$2/; # Fix space before timezone
$timestamp =~ s/ //g; # Remove any remaining spaces
my $pct = $json->{summary}{Total}{total}{percentage} // 0;
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