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
# 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
# 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
lib/Catmandu/BagIt.pm view on Meta::CPAN
}
# Read the real listing of files as found on the disk
printf "files:\n";
for my $file ($bagit->list_files) {
my $stat = [stat($file->path)];
printf " name: %s\n", $file->filename;
printf " size: %s\n", $stat->[7];
printf " last-mod: %s\n", scalar(localtime($stat->[9]));
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/Store/File/Simple/Bag.pm view on Meta::CPAN
my $file = File::Spec->catfile($path, $packed_key);
return undef unless -f $file;
my $stat = [stat($file)];
my $size = $stat->[7];
my $modified = $stat->[9];
my $created = $stat->[10]; # no real creation time exists on Unix
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/Fix/file_stat.pm view on Meta::CPAN
my $temp_var = $fixer->generate_var();
my $perl = <<EOF;
if (is_string(${var})) {
my ${temp_var} = [stat(${var})];
if( scalar(\@{${temp_var}}) ){
${var} = {
dev => ${temp_var}->[0],
lib/Catmandu/Fix/file_stat.pm view on Meta::CPAN
add_field('path','/home/njfranck/test.txt')
#'path' is now a hash containing keys like mode, uid, gid, size, atime ..
file_stat('path')
=head1 AUTHOR
Nicolas Franck, C<< <nicolas.franck at ugent.be> >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/Exporter/Stat.pm view on Meta::CPAN
for my $key (@keys) {
my $stats = {};
$stats->{name} = $key;
$stats->{count} = $self->{res}->{$key}->{count};
$stats->{min} = $self->get_stat($key)->min();
$stats->{max} = $self->get_stat($key)->max();
$stats->{mean} = $self->get_stat($key)->mean();
$stats->{variance} = sprintf "%.1f" , $self->get_stat($key)->variance();
$stats->{stdev} = sprintf "%.1f" , $self->get_stat($key)->standard_deviation();
my ($zeros,$zerosp,$occur_count,$values_count,$uniqs);
$zeros = $self->{res}->{$key}->{zero} // 0;
$values_count = $self->{res}->{$key}->{count};
$occur_count = $self->get_stat($key)->count();
$zerosp = sprintf "%.1f" , $occur_count > 0 ? 100 * $zeros / $occur_count : 100;
$uniqs = sprintf "%.1f" , $values_count > 0 ? 100 * $self->get_key_uniq($key) / $values_count : 0.0;
my $overflow = $values_count > 0 ? 100 * $self->get_key_uniq($key) / $values_count : 0.0;
$overflow = $overflow > 100 ? 1 : 0;
view all matches for this distribution
view release on metacpan or search on metacpan
src/matcher.cc view on Meta::CPAN
bool MappedFile::map(const std::string& path) {
_fd = open(path.c_str(), O_RDONLY);
if (_fd < 0) return false;
struct stat st;
if (fstat(_fd, &st) != 0 || st.st_size <= 0) {
close(_fd);
_fd = -1;
return false;
}
void* p = mmap(nullptr, (size_t)st.st_size, PROT_READ, MAP_SHARED, _fd, 0);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CellFunc/File/stat_row.pm view on Meta::CPAN
'table.field_formats' => \@st_field_formats,
};
$SPEC{func} = {
v => 1.1,
summary => 'Take input value as filename, generate a row from stat()',
description => <<'MARKDOWN',
When file does not exist or cannot be `stat()`'d, will emit a warning and return
an undefined value instead of a row.
MARKDOWN
args => {
value => {
lib/CellFunc/File/stat_row.pm view on Meta::CPAN
follow_symlink => {
schema => 'bool*',
default => 1,
description => <<'MARKDOWN',
If set to false, will do an `lstat()` instead of `stat()`.
MARKDOWN
},
},
};
sub func {
my %args = @_;
my @st = ($args{follow_symlink} // 1) ? stat($args{value}) : lstat($args{value});
unless (@st) {
log_warn "Can't stat/lstat(%s): %s", $args{value}, $!;
return [200, "OK"];
}
[200, "OK", \@st, $resmeta];
}
1;
# ABSTRACT: Take input value as filename, generate a row from stat()
__END__
=pod
=encoding UTF-8
=head1 NAME
CellFunc::File::stat_row - Take input value as filename, generate a row from stat()
=head1 VERSION
This document describes version 0.001 of CellFunc::File::stat_row (from Perl distribution CellFunc-File-stat_row), released on 2024-12-10.
lib/CellFunc/File/stat_row.pm view on Meta::CPAN
Usage:
func(%args) -> [$status_code, $reason, $payload, \%result_meta]
Take input value as filename, generate a row from stat().
When file does not exist or cannot be C<stat()>'d, will emit a warning and return
an undefined value instead of a row.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<follow_symlink> => I<bool> (default: 1)
If set to false, will do an C<lstat()> instead of C<stat()>.
=item * B<value>* => I<filename>
(No description)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ceph/Rados/Striper.pm view on Meta::CPAN
my $is_writable_object = blessed($handle) and $handle->can('write');
Carp::confess "Called with neither an open filehandle equivalent nor an object with a \`write\` method"
unless $is_filehandle or $is_writable_object;
$off //= 0;
if (!$len) {
($len, undef) = $self->_stat($soid);
}
my $count = 0;
#
for (my $pos = $off; $pos <= $len+$off; $pos += $CHUNK_SIZE) {
my $chunk;
lib/Ceph/Rados/Striper.pm view on Meta::CPAN
sub read {
my ($self, $soid, $len, $off) = @_;
# if undefined is passed as len, we stat the obj first to get the correct len
if (!defined($len)) {
($len, undef) = $self->stat($soid);
}
$off ||= 0;
$self->_read($soid, $len, $off);
}
sub stat {
my ($self, $soid) = @_;
$self->_stat($soid);
}
sub mtime {
my ($self, $soid) = @_;
my (undef, $mtime) = $self->stat($soid);
$mtime;
}
sub size {
my ($self, $soid) = @_;
my ($size, undef) = $self->stat($soid);
$size;
}
sub remove {
my ($self, $soid) = @_;
lib/Ceph/Rados/Striper.pm view on Meta::CPAN
=head2 append(soid, data)
Wraps C<rados_striper_append()>. Appends data to the ceph object with the supplied ID. Data must be a perl scalar, not a handle. Returns 1 on success. Croaks on failure.
=head2 stat(soid)
Wraps C<rados_striper_stat()>. Returns a 2-element list of (filesize, mtime) for the ceph object with the supplied ID.
=head2 read(soid, len=filesize, offset=0)
Wraps C<rados_striper_read()>. Read data from the ceph object with the supplied ID, and return the data read. Croaks on failure.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ceph/Rados.pm view on Meta::CPAN
$cluster->connect;
my $io = $cluster->io('testing_pool');
$io->write('greeting', 'hello');
my $stored_data = $io->read('greeting',10);
my ($len, $mtime) = $io->stat('greeting');
$io->delete('greeting');
my $list = $io->list;
while (my $entry = $list->next) {
print "Found $entry\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CfgTie/TieRCService.pm view on Meta::CPAN
}
$F->close;
return $pid;
}
sub _stat($)
{
my $self=shift;
if (!defined $self) {return undef;}
return stat("/var/run/".$self->{'name'}.".pid");
}
sub EXISTS ($$)
{
my ($self,$key)=@_;
lib/CfgTie/TieRCService.pm view on Meta::CPAN
scan_rcscript($self);
return exists $self->{$lkey};
}
elsif ($lkey eq 'stat')
{
my @A= _stat($self);
if (scalar @A) {$self->{'stat'}=[@A]; return 1;}
}
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ChainMake.pm view on Meta::CPAN
last REQUIREMENTS unless ($insistent);
}
}
# oder der Name einer Datei?
elsif (-e $dep) {
$age=(stat($dep))[9];
}
# Requirement nicht auffindbar
else {
$self->_diag(1,"Missing requirement '$dep'.\n");
$cannot_make=1;
lib/ChainMake.pm view on Meta::CPAN
sub _check_file_timestamps {
my ($self,$ver)=@_;
my ($oldest,$youngest,$missing);
for my $timestamps (@{$ver}) {
if (-e $timestamps) {
my $mtime = (stat($timestamps))[9];
$youngest=$mtime unless (($youngest) && ($youngest >= $mtime));
$oldest=$mtime unless (($oldest) && ($oldest <= $mtime));
}
else {
$missing=$timestamps;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chandra/HotReload.pm view on Meta::CPAN
});
$app->run; # automatically polls during event loop
=head1 DESCRIPTION
Chandra::HotReload provides file-system watching via C<stat()> polling.
Register paths (files or directories) to watch along with callbacks
that are invoked whenever a change is detected.
When integrated with L<Chandra::App> via C<< $app->watch() >>, the
event loop automatically switches to non-blocking mode and polls for
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Arabic.pm view on Meta::CPAN
# Filter >>>
# Source >
# Escape >>>>> executable without re-escape
#----------------------------------------------------
my $mtime_filter = (stat(__FILE__ ))[9];
my $mtime_source = (stat($filename ))[9];
my $mtime_escape = (stat("$filename.e"))[9];
if (($mtime_escape < $mtime_source) or ($mtime_escape < $mtime_filter)) {
unlink "$filename.e";
}
}
}
lib/Arabic.pm view on Meta::CPAN
seek($fh, 0, 0) or die __FILE__, ": Can't seek file: $filename.e\n";
my $e_script = Arabic::escape_script($filename);
print {$fh} $e_script;
my $mode = (stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5HKSCS.pm view on Meta::CPAN
# Filter >>>
# Source >
# Escape >>>>> executable without re-escape
#----------------------------------------------------
my $mtime_filter = (Ebig5hkscs::stat(__FILE__ ))[9];
my $mtime_source = (Ebig5hkscs::stat($filename ))[9];
my $mtime_escape = (Ebig5hkscs::stat("$filename.e"))[9];
if (($mtime_escape < $mtime_source) or ($mtime_escape < $mtime_filter)) {
Ebig5hkscs::unlink "$filename.e";
}
}
}
lib/Big5HKSCS.pm view on Meta::CPAN
seek($fh, 0, 0) or die __FILE__, ": Can't seek file: $filename.e\n";
my $e_script = Big5HKSCS::escape_script($filename);
print {$fh} $e_script;
my $mode = (Ebig5hkscs::stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
lib/Big5HKSCS.pm view on Meta::CPAN
support these.
=item * ${^WIN32_SLOPPY_STAT} is ignored
Even if ${^WIN32_SLOPPY_STAT} is set to a true value, file test functions Ebig5hkscs::*(),
Ebig5hkscs::lstat(), and Ebig5hkscs::stat() on Microsoft Windows open the file for the path
which has chr(0x5c) at end.
=item * Delimiter of String and Regexp
qq//, q//, qw//, qx//, qr//, m//, s///, tr///, and y/// can't use a wide character
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Big5Plus.pm view on Meta::CPAN
# Filter >>>
# Source >
# Escape >>>>> executable without re-escape
#----------------------------------------------------
my $mtime_filter = (Ebig5plus::stat(__FILE__ ))[9];
my $mtime_source = (Ebig5plus::stat($filename ))[9];
my $mtime_escape = (Ebig5plus::stat("$filename.e"))[9];
if (($mtime_escape < $mtime_source) or ($mtime_escape < $mtime_filter)) {
Ebig5plus::unlink "$filename.e";
}
}
}
lib/Big5Plus.pm view on Meta::CPAN
seek($fh, 0, 0) or die __FILE__, ": Can't seek file: $filename.e\n";
my $e_script = Big5Plus::escape_script($filename);
print {$fh} $e_script;
my $mode = (Ebig5plus::stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
lib/Big5Plus.pm view on Meta::CPAN
support these.
=item * ${^WIN32_SLOPPY_STAT} is ignored
Even if ${^WIN32_SLOPPY_STAT} is set to a true value, file test functions Ebig5plus::*(),
Ebig5plus::lstat(), and Ebig5plus::stat() on Microsoft Windows open the file for the path
which has chr(0x5c) at end.
=item * Delimiter of String and Regexp
qq//, q//, qw//, qx//, qr//, m//, s///, tr///, and y/// can't use a wide character
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cyrillic.pm view on Meta::CPAN
# Filter >>>
# Source >
# Escape >>>>> executable without re-escape
#----------------------------------------------------
my $mtime_filter = (stat(__FILE__ ))[9];
my $mtime_source = (stat($filename ))[9];
my $mtime_escape = (stat("$filename.e"))[9];
if (($mtime_escape < $mtime_source) or ($mtime_escape < $mtime_filter)) {
unlink "$filename.e";
}
}
}
lib/Cyrillic.pm view on Meta::CPAN
seek($fh, 0, 0) or die __FILE__, ": Can't seek file: $filename.e\n";
my $e_script = Cyrillic::escape_script($filename);
print {$fh} $e_script;
my $mode = (stat($filename))[2] & 0777;
chmod $mode, "$filename.e";
close($fh) or die "Can't close file: $filename.e: $!";
}
view all matches for this distribution