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
# 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/Code/ART.pm view on Meta::CPAN
"\${^UTF8CACHE}" =>
{ aliases => {}, desc => "Internal UTF-8 offset caching controls" },
"\${^UTF8LOCALE}" => { aliases => {}, desc => "UTF-8 locale" },
"\${^WARNING_BITS}" => { aliases => {}, desc => "Lexical warning flags" },
"\${^WIN32_SLOPPY_STAT}" =>
{ aliases => {}, desc => "Use non-opening stat() under Windows" },
"\$|" => {
aliases => { "\$OUTPUT_AUTOFLUSH" => 1 },
desc => "Autoflush status of selected output filehandle",
},
"\$~" => {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/DRY.pm view on Meta::CPAN
my $here = 0;
for my $file (@{$rfiles}) {
next if (!defined $file || $file eq '');
# check metadata
if ($^O ne 'MSWin32') {
my @statresult = stat($file);
if (0 < $#statresult) {
my $inode = $statresult[1]; # inode
if (exists $filename2inode{$inode}) {
$file = undef;
next; # avoid hard and symbolic links
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/Code/Statistics/App/Command.pm view on Meta::CPAN
use App::Cmd::Setup -command;
sub cstat {
return shift->app->cstat( @_ );
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/TidyAll.pm view on Meta::CPAN
$self->msg('purging old backups') if $self->verbose;
find(
{
follow => 0,
wanted => sub {
unlink $_ if -f && /\.bak$/ && time > ( stat($_) )[9] + $self->_backup_ttl_secs;
},
no_chdir => 1
},
$self->_backup_dir,
);
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
# 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/Colloquy/Data.pm view on Meta::CPAN
my $file = shift;
croak "No such file '$file'\n" unless -e $file;
croak "'$file' is not a plain file type\n" unless -f _;
croak "Insufficient permissions to read file '$file'\n" unless -r _;
my $mode = (stat(_))[2];
my $group_write = ($mode & S_IWGRP) >> 3;
my $other_write = $mode & S_IWOTH;
# Since this module started using Safe to parse the data files,
# this code is no longer as important as before. It's now only
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Comics.pm view on Meta::CPAN
@files =
map { $_->[0] }
sort { $b->[1] <=> $a->[1] }
grep { $force || ! $state->{comics}->{$_->[2]}->{disabled} }
map { ( my $t = $_ ) =~ s/\.\w+$//;
[ $_, (stat($_))[9], $t ] }
@files;
if ( $debug > 1 ) {
warn("Images (sorted):\n");
warn(" $_\n") for @files;
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
lib/Comparer/file_mtime.pm view on Meta::CPAN
my $follow_symlink = $args{follow_symlink} // 1;
my $reverse = $args{reverse};
sub {
my @st1 = $follow_symlink ? stat($_[0]) : lstat($_[0]);
my @st2 = $follow_symlink ? stat($_[1]) : lstat($_[1]);
(
$st1[9] <=> $st2[9]
) * ($reverse ? -1 : 1)
};
lib/Comparer/file_mtime.pm view on Meta::CPAN
=head1 COMPARER ARGUMENTS
=head2 follow_symlink
Bool, default true. If set to false, will use C<lstat()> function instead of the
default C<stat()>.
=head2 reverse
Bool.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Comparer/file_num_links.pm view on Meta::CPAN
my $follow_symlink = $args{follow_symlink} // 1;
my $reverse = $args{reverse};
sub {
my @st1 = $follow_symlink ? stat($_[0]) : lstat($_[0]);
my @st2 = $follow_symlink ? stat($_[1]) : lstat($_[1]);
(
$st1[3] <=> $st2[3]
) * ($reverse ? -1 : 1)
};
lib/Comparer/file_num_links.pm view on Meta::CPAN
=head1 COMPARER ARGUMENTS
=head2 follow_symlink
Bool, default true. If set to false, will use C<lstat()> function instead of the
default C<stat()>.
=head2 reverse
Bool.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Comparer/file_size.pm view on Meta::CPAN
my $follow_symlink = $args{follow_symlink} // 1;
my $reverse = $args{reverse};
sub {
my @st1 = $follow_symlink ? stat($_[0]) : lstat($_[0]);
my @st2 = $follow_symlink ? stat($_[1]) : lstat($_[1]);
(
$st1[7] <=> $st2[7]
) * ($reverse ? -1 : 1)
};
lib/Comparer/file_size.pm view on Meta::CPAN
=head1 COMPARER ARGUMENTS
=head2 follow_symlink
Bool, default true. If set to false, will use C<lstat()> function instead of the
default C<stat()>.
=head2 reverse
Bool.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Complete/File.pm view on Meta::CPAN
my $filter;
if ($args{filter} && !ref($args{filter})) {
my @seqs = split /\s*\|\s*/, $args{filter};
$filter = sub {
my $name = shift;
my @st = stat($name) or return 0;
my $mode = $st[2];
my $pass;
SEQ:
for my $seq (@seqs) {
my $neg = sub { $_[0] };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Compress/Bzip2.pm view on Meta::CPAN
if ( !@statbuf ) {
print STDERR "Error: failed to stat $infile: '$!'\n";
next;
}
if ( !_check_stat( $infile, \@statbuf, $opts{f} ) ) {
print STDERR "Error: file $infile stat check fails: $bzerrno\n";
next;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/contrib/diagnose_corruption/check_flipped_bits.c view on Meta::CPAN
int ret;
FILE* f;
char *buf;
size_t bytes_read;
ret = stat(filename, &statbuf);
if (ret != 0) {
fprintf(stderr, "stat failed: %m\n");
return NULL;
}
if ((statbuf.st_mode & S_IFREG) != S_IFREG) {
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/contrib/pzstd/utils/FileSystem.h view on Meta::CPAN
inline file_status status(StringPiece path, std::error_code& ec) noexcept {
file_status status;
#if defined(_MSC_VER)
const auto error = ::_stat64(path.data(), &status);
#else
const auto error = ::stat(path.data(), &status);
#endif
if (error) {
ec.assign(errno, std::generic_category());
} else {
ec.clear();
ext/zstd/contrib/pzstd/utils/FileSystem.h view on Meta::CPAN
#if defined(S_ISREG)
return S_ISREG(status.st_mode);
#elif !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
return (status.st_mode & S_IFMT) == S_IFREG;
#else
static_assert(false, "No POSIX stat() support.");
#endif
}
/// http://en.cppreference.com/w/cpp/filesystem/is_regular_file
inline bool is_regular_file(StringPiece path, std::error_code& ec) noexcept {
ext/zstd/contrib/pzstd/utils/FileSystem.h view on Meta::CPAN
#if defined(S_ISDIR)
return S_ISDIR(status.st_mode);
#elif !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
return (status.st_mode & S_IFMT) == S_IFDIR;
#else
static_assert(false, "NO POSIX stat() support.");
#endif
}
/// http://en.cppreference.com/w/cpp/filesystem/is_directory
inline bool is_directory(StringPiece path, std::error_code& ec) noexcept {
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
scripts/generate_index.pl view on Meta::CPAN
$total_pct
);
}
my $timestamp = 'Unknown';
if (my $stat = stat($config{cover_db})) {
$timestamp = strftime('%Y-%m-%d %H:%M:%S', localtime($stat->mtime));
}
Readonly my $commit_url => "https://github.com/$config{github_user}/$config{github_repo}/commit/$commit_sha";
my $short_sha = substr($commit_sha, 0, 7);
scripts/generate_index.pl view on Meta::CPAN
next unless $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
lib/Config/Augeas/Exporter.pm view on Meta::CPAN
my %stat;
($stat{dev}, $stat{ino}, $stat{mode}, $stat{nlink},
$stat{uid}, $stat{gid}, $stat{rdev}, $stat{size},
$stat{atime}, $stat{mtime}, $stat{ctime},
$stat{blksize}, $stat{blocks}) = stat("${aug_root}${path}");
my $stat_elem = XML::LibXML::Element->new('stat');
for my $k (keys(%stat)) {
$stat_elem->setAttribute($k, $stat{$k});
view all matches for this distribution
view release on metacpan or search on metacpan
t/Config-AugeasC.t view on Meta::CPAN
# test augeas without backup file
cleanup;
my $h_file = $aug_root."etc/hosts" ;
my $h_size = stat($h_file)->size ;
my $aug = Config::Augeas::init($aug_root, '' ,0) ;
ok($aug,"Created new Augeas object without backup file");
t/Config-AugeasC.t view on Meta::CPAN
is($ret,0,"Set new host name");
$ret = $aug->save ;
is($ret,0,"Save with backup done") ;
is( stat($h_file)->size , $h_size + 6 , "Check new file size") ;
# test augeas with backup file
cleanup;
my $augb = Config::Augeas::init($aug_root, '' ,
t/Config-AugeasC.t view on Meta::CPAN
$ret = $augb->save ;
is($ret,0,"Save with backup done") ;
my $b_file = $h_file.".augsave" ;
ok( -e $b_file , "Backup file was written" ) ;
is( stat($b_file)->size , $h_size, "compare file sizes") ;
# complete test with save file
cleanup ;
view all matches for this distribution
view release on metacpan or search on metacpan
t/02.compile.t view on Meta::CPAN
);
Config::AutoConf->write_config_h();
ok(-f "config.h", "default config.h created");
my $fsize;
ok($fsize = (stat("config.h"))[7], "config.h contains content");
$ac->write_config_h();
ok(-f "config.h", "default config.h created");
cmp_ok((stat("config.h"))[7], ">", $fsize, "2nd config.h is bigger than first (more checks made)");
my ($fh, $fbuf, $dbuf);
open($fh, "<", "config.h");
{ local $/; $fbuf = <$fh>; }
close($fh);
view all matches for this distribution