view release on metacpan or search on metacpan
}
/* Get file information (note we simplistically determine if it's an MP3
file or not by checking for a .mp3 extension) */
if (stat(fname,&fileinfo) != 0) {
RMP_TRACE(fprintf(stderr, "Unable to access file %s\n",fname));
return 0;
}
fsize = fileinfo.st_size;
RMP_TRACE(fprintf(stderr, "File Name: %s File Size: %u\n",&tagbuff[20],fsize)); /**/
/* Check if file already exists */
if (stat(&tagbuff[20],&fileinfo) == 0) {
RMP_TRACE(fprintf(stderr, "\n*** File with same name already exists - download cancelled ***\n"));
free(baseblk);
free(datablk);
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
mtime = fileInfo.ftLastWriteTime.dwLowDateTime;
size = (uint64_t)fileInfo.nFileSizeLow;
#else
struct stat buf;
if (stat(file, &buf) != -1) {
mtime = (int)buf.st_mtime;
size = (uint64_t)buf.st_size;
}
#endif
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
xt/copyright.t view on Meta::CPAN
my $modified_ts;
if( $is_checkout ) {
# diag `git log -1 --pretty="format:%ct" "$file"`;
$modified_ts = `git log -1 --pretty="format:%ct" "$file"`;
} else {
$modified_ts = (stat($_))[9];
}
my $modified_year;
if( $modified_ts ) {
$modified_year = strftime('%Y', localtime($modified_ts));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Auth/Kokolores.pm view on Meta::CPAN
return;
}
sub post_bind_hook {
my $self = shift;
$self->_set_process_stat('master');
$self->set_socket_permissions;
return;
}
sub set_socket_permissions {
lib/Auth/Kokolores.pm view on Meta::CPAN
}
sub child_init_hook {
my $self = shift;
$self->{'plugins'}->child_init( $self );
$self->_set_process_stat('virgin child');
return;
}
sub child_finish_hook {
my $self = shift;
lib/Auth/Kokolores.pm view on Meta::CPAN
$self->log(4, "accepted new client on port $port");
my $protocol = $self->get_protocol_handler( $conn, $port );
$protocol->init_connection;
$self->_set_process_stat('waiting request');
my $r = $protocol->read_request;
$self->_set_process_stat('processing request');
my $response;
eval { $response = $self->process_kokolores_request( $r ); };
if( $@ ) {
$self->log(1, 'processing request failed: '.$@);
return;
}
$protocol->write_response( $response );
$protocol->shutdown_connection;
$self->_set_process_stat('idle');
return;
}
sub _set_process_stat {
my ( $self, $stat ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
(ABSTRACT_FROM => 'Krb5Afs.pm', # retrieve abstract from module
AUTHOR => 'Noel Burton-Krahn <noel@bkbox.com>') : ()),
EXE_FILES => [ 'authkrb5afs' ],
);
@l = stat("Makefile") or die("stat: $!");
open(F, "+<Makefile") or die("open: $!");
read(F, $_, $l[7]);
close(F);
s/Auth::authkrb5afs/authkrb5afs/g;
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/File/Temp.pm view on Meta::CPAN
# Will not work on systems that do not support sticky bit
#Args: directory path to check
# Optionally: reference to scalar to contain error message
# Returns true if the path is safe and false otherwise.
# Returns undef if can not even run stat() on the path
# This routine based on version written by Tom Christiansen
# Presumably, by the time we actually attempt to create the
# file or directory in this directory, it may not be safe
inc/File/Temp.pm view on Meta::CPAN
my $path = shift;
my $err_ref = shift;
# Stat path
my @info = stat($path);
unless (scalar(@info)) {
$$err_ref = "stat(path) returned no values";
return 0;
};
return 1 if $^O eq 'VMS'; # owner delete control at file level
# Check to see whether owner is neither superuser (or a system uid) nor me
inc/File/Temp.pm view on Meta::CPAN
unless scalar(@_) == 2;
# Read args
my ($fh, $path) = @_;
cmpstat($fh, $path) or return 0;
# attempt remove the file (does not work on some platforms)
if (_can_unlink_opened_file()) {
# return early (Without unlink) if we have been instructed to retain files.
inc/File/Temp.pm view on Meta::CPAN
#line 1999
sub cmpstat {
croak 'Usage: cmpstat(filehandle, filename)'
unless scalar(@_) == 2;
# Read args
my ($fh, $path) = @_;
inc/File/Temp.pm view on Meta::CPAN
unless scalar(@_) == 2;
# Read args
my ($fh, $path) = @_;
cmpstat($fh, $path) or return 0;
# Close the file
close( $fh ) or return 0;
# Make sure the file is writable (for windows)
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/AutoSplit.pm view on Meta::CPAN
# allow just a package name to be used
$filename .= ".pm" unless ($filename =~ m/\.pm\z/);
open(my $in, "<$filename") or die "AutoSplit: Can't open $filename: $!\n";
my($pm_mod_time) = (stat($filename))[9];
my($autoloader_seen) = 0;
my($in_pod) = 0;
my($def_package,$last_package,$this_package,$fnr);
while (<$in>) {
# Skip pod text.
lib/AutoSplit.pm view on Meta::CPAN
$Is_VMS && $filename =~ m/$modpname.pm/i);
my($al_idx_file) = catfile($autodir, $modpname, $IndexFile);
if ($check_mod_time){
my($al_ts_time) = (stat("$al_idx_file"))[9] || 1;
if ($al_ts_time >= $pm_mod_time and
$al_ts_time >= $self_mod_time){
print "AutoSplit skipped ($al_idx_file newer than $filename)\n"
if ($Verbose >= 2);
return undef; # one undef, not a list
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AutoSession/Driver/File.pm view on Meta::CPAN
# TIME #
########
sub time {
my $this = shift ;
my @stats = stat($this->{file}) ;
if (! $stats[7] ) { return( 0 ) ;}
return( $stats[9] ) ;
}
########
lib/AutoSession/Driver/File.pm view on Meta::CPAN
while (my $filename = readdir $dh) {
if ($filename =~ /^SESSION-(\w+)\.(?:tmp|hpl)$/s) {
my $id = $1 ;
my $file = "$this->{dir}/$filename" ;
my @stats = stat($file) ;
my $size = @stats[7] ;
my $mdtime = @stats[9] ;
if ($id ne $this->{id} && ($size || ($size == 0 && (time-$mdtime) > 60*60*24) ) ) {
my %headers = $this->get_file_header($file) ;
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/AxKit/App/Gallery/Plugin.pm view on Meta::CPAN
my $image = Imager->new();
if(! -f $cachedfile
|| -z $cachedfile
|| (stat($r->filename()))[9] > (stat($cachedfile))[9]) {
# $r->log_error("will open " . $r->filename());
$image->open(file => $r->filename())
or die $image->errstr();
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
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/AxKit2/Plugin.pm view on Meta::CPAN
In asynchronous I/O the action is requested and a callback is provided to
be called when the action has occured. This allows the event loop to continue
processing other requests while we are waiting for the disk.
This is better explained with a simple example. For this example we'll take the
C<stat()> system call in an attempt to find out if the filename we are
requesting is a directory or not. In perl we would normally perform this with
the following code:
sub hook_response {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/B/DeparseTree/PPfns.pm view on Meta::CPAN
sub filetest
{
my($self, $op, $cx, $name) = @_;
if (B::class($op) eq "UNOP") {
# Genuine '-X' filetests are exempt from the LLAFR, but not
# l?stat()
if ($name =~ /^-/) {
my $kid = $self->deparse($op->first, 16, $op);
return $self->info_from_template("filetest $name", $op,
"$name %c", undef, [$kid],
{maybe_parens => [$self, $cx, 16]});
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
t/0019-tempfile-security.t view on Meta::CPAN
}
no strict 'refs';
my $path = &{"BATsh::SH::_subst_tempfile"}();
my $ok = 0;
if (defined $path && -f $path) {
my @st = stat($path);
$ok = (($st[2] & 07777) == 0600) ? 1 : 0;
}
close(*BATsh::SH::_SUBST_CAPFH) if defined fileno(*BATsh::SH::_SUBST_CAPFH);
unlink $path if defined $path;
_ok($ok, 'TS02: subst capture file created with mode 0600');
t/0019-tempfile-security.t view on Meta::CPAN
no strict 'refs';
my $stub = File::Spec->catfile($TMPDIR, "batsh_shp19_$$");
my $path = &{"BATsh::SH::_shp_tempfile"}($stub);
my $ok = 0;
if (defined $path && -f $path) {
my @st = stat($path);
$ok = (($st[2] & 07777) == 0600) ? 1 : 0;
}
close(*BATsh::SH::_SH_PIPE_WFH) if defined fileno(*BATsh::SH::_SH_PIPE_WFH);
unlink $path if defined $path;
_ok($ok, 'TS04: pipe stage file created with mode 0600');
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