Result:
found more than 1305 distributions - search limited to the first 2001 files matching your query ( run in 3.564 )


App-perlmv-scriptlet-add_prefix_datestamp

 view release on metacpan or  search on metacpan

lib/App/perlmv/scriptlet/add_prefix_datestamp.pm  view on Meta::CPAN

        my $re = $ARGS->{prefix_regex} // qr/\A[12][0-9]{3}(0[1-9]|10|11|12)([0-2][0-9]|30|31)-/;

        if ($ARGS->{avoid_duplicate_prefix} && $_ =~ $re) {
            return $_;
        }
        my @stat = stat($_);
        my $time   = defined $ARGS->{date} ? main::_parse_date($ARGS->{date}) : $stat[9];
        my $format = $ARGS->{prefix_format}  // ($ARGS->{with_time} ? '%Y%m%dT%H%M%S-' : '%Y%m%d-');
        my $prefix = POSIX::strftime($format, localtime($time));

        "$prefix$_";

 view all matches for this distribution


App-phoebe

 view release on metacpan or  search on metacpan

lib/App/Phoebe.pm  view on Meta::CPAN

  my ($sec, $min, $hour, $mday, $mon, $year) = gmtime(shift);
  return sprintf('%02d:%02d UTC', $hour, $min);
}

sub modified {
  my $ts = (stat(shift))[9];
  return $ts;
}

sub serve_history {
  my $stream = shift;

 view all matches for this distribution


App-plx

 view release on metacpan or  search on metacpan

bin/plx-packed  view on Meta::CPAN

  $fatpacked{"File/pushd.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'FILE_PUSHD';
    use strict;use warnings;package File::pushd;our$VERSION='1.009';our@EXPORT=qw(pushd tempd);our@ISA=qw(Exporter);use Exporter;use Carp;use Cwd qw(getcwd abs_path);use File::Path qw(rmtree);use File::Temp qw();use File::Spec;use overload q{""}=>sub...
  FILE_PUSHD
  
  $fatpacked{"HTTP/Tiny.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'HTTP_TINY';
    package HTTP::Tiny;use strict;use warnings;our$VERSION='0.056';use Carp ();my@attributes;BEGIN {@attributes=qw(cookie_jar default_headers http_proxy https_proxy keep_alive local_address max_redirect max_size proxy no_proxy timeout SSL_options ver...
        sub $sub_name {
            my (\$self, \$url, \$args) = \@_;
            \@_ == 2 || (\@_ == 3 && ref \$args eq 'HASH')
            or Carp::croak(q/Usage: \$http->$sub_name(URL, [HASHREF])/ . "\n");
            return \$self->request('$req_method', \$url, \$args || {});

 view all matches for this distribution


App-ppgrep

 view release on metacpan or  search on metacpan

script/_ppgrep  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] };

script/_ppgrep  view on Meta::CPAN

#                               atime mtime ctime blksize blocks);
#                undef $value;
#                $value->{stat} = YAML::Old::Node->new({});
#                if ($value->{fileno} = fileno(*{$_[0]})) {
#                    local $^W;
#                    map {$value->{stat}{shift @stats} = $_} stat(*{$_[0]});
#                    $value->{tell} = tell(*{$_[0]});
#                }
#            }
#            $ynode->{$type} = $value;
#        }

 view all matches for this distribution


App-psst

 view release on metacpan or  search on metacpan

t/00-sane.t  view on Meta::CPAN

}


sub devino {
  my ($fn) = @_;
  my @s = stat($fn);
  return @s ? "$s[0]:$s[1]" : "$fn absent";
}


main();

 view all matches for this distribution


App-ptimeout

 view release on metacpan or  search on metacpan

inc/Devel/CheckOS.pm  view on Meta::CPAN

sub list_platforms {
    # sort by mtime, so oldest last. This was necessary so that if a module
    # appears twice in @INC we pick the newer one but that functionality is
    # no longer needed. We do need to de-dupe the list though
    my @modules = sort {
        (stat($a->{file}))[9] <=> (stat($b->{file}))[9]
    } grep {
        $_->{module} !~ $re_Alias
    } map {
        my (undef, $dir_part, $file_part) = File::Spec->splitpath($_);
        $file_part =~ s/\.pm$//;

 view all matches for this distribution


App-reposdb

 view release on metacpan or  search on metacpan

lib/App/reposdb.pm  view on Meta::CPAN

extra data. They have various uses, but my first use-case for this is to store
last commit/status/pull time (updated via a post-commit git hook or `gitwrap`).
This is useful to speed up like syncing of repositories in `Git::Bunch` that
wants to find out which of the hundreds/thousand+ git repositories are "the most
recently used" to prioritize these repositories first. Using information from
`repos.db` is faster than having to `git status` or even stat() each repository.

_
};

sub _complete_repo {

lib/App/reposdb.pm  view on Meta::CPAN

extra data. They have various uses, but my first use-case for this is to store
last commit/status/pull time (updated via a post-commit git hook or C<gitwrap>).
This is useful to speed up like syncing of repositories in C<Git::Bunch> that
wants to find out which of the hundreds/thousand+ git repositories are "the most
recently used" to prioritize these repositories first. Using information from
C<repos.db> is faster than having to C<git status> or even stat() each repository.

=head1 FUNCTIONS


=head2 add_repo_tag

 view all matches for this distribution


App-rimetadb

 view release on metacpan or  search on metacpan

lib/App/rimetadb.pm  view on Meta::CPAN

        log_debug("Processing package $pkg ...");
        #sleep 1;
        my $rec = $dbh->selectrow_hashref("SELECT * FROM package WHERE name=?",
                                          {}, $pkg);
        my $mp = Module::Path::More::module_path(module=>$pkg);
        my @st; @st = stat($mp) if $mp;

        unless ($args{force} || !$rec || !$rec->{mtime} || !@st || $rec->{mtime} < $st[9]) {
            log_debug("$pkg ($mp) hasn't changed since last recorded, skipped");
            next;
        }

 view all matches for this distribution


App-rs

 view release on metacpan or  search on metacpan

rs.xs  view on Meta::CPAN

void *mmapr(const char *f, off_t *l)
{
	int	fd;
	errn1(fd = open(f, O_RDONLY));
	struct stat	b;
	errn1(fstat(fd, &b));
	if (l)	*l = b.st_size;
	void	*p = NULL;
	if (b.st_size)
		errn1((long int)(p = mmap(0, b.st_size, PROT_READ, MAP_PRIVATE, fd, 0)));
	errn1(close(fd));

 view all matches for this distribution


App-rsync-new2old

 view release on metacpan or  search on metacpan

script/newest-mtime  view on Meta::CPAN

use Getopt::Long;

sub find_newest_mtime {
    my $path = shift;

    my @st = lstat($path) or return (0, $path);
    my $is_dir = (-d _);
    my $mtime = $st[9];
    if ($is_dir) {
        opendir my($dh), $path or do {
            warn "newest-mtime: Can't opendir $path: $!, skipped\n";

 view all matches for this distribution


App-timestamp

 view release on metacpan or  search on metacpan

timestamp  view on Meta::CPAN

#sysread $FH , my $s1 , 2 * $LEN ; 
#my $s2 = substr $s1 , $LEN , $LEN , '' ;
#$flg = 0 unless $s1 =~ m/^\Q$H\E.*:.*\n$/ && $s2 =~ m/^\Q$H\E.*:.*\n$/ ; 
#$flg ? sysseek $FH , -$LEN , 1 : sysseek $FH , 0, 2 ;

#my $fp = (stat($FH))[2] ; say $fp ;chmod 000, $FH ; $FH->flush ;
print $FH "$DTSTR\n" ; # flock $FH , LOCK_UN ; 
#$FH->flush ;chmod $fp, $FH ; 
#sleep 5 ;

close $FH ; 

 view all matches for this distribution


App-todoist

 view release on metacpan or  search on metacpan

lib/App/todoist.pm  view on Meta::CPAN

    $config->define('priority',     { ARGCOUNT => 1, ALIAS => 'p', DEFAULT => 4 });
    $config->define('add-project',  { ARGCOUNT => 1, ALIAS => 'ap' });

    if (defined($ENV{HOME}) && -f "$ENV{HOME}/.todoist") {
        my $filename = "$ENV{HOME}/.todoist";
        if (((stat($filename))[2] & 36) != 0) {
            croak "your config file ($filename) is readable by others!\n";
        }
        $config->file($filename) || exit 1;
    }

 view all matches for this distribution


App-wmiirc

 view release on metacpan or  search on metacpan

lib/App/wmiirc/Ssh.pm  view on Meta::CPAN

  my($self, @args) = @_;
  state($last_mtime, @hosts);

  my $known_hosts = "$ENV{HOME}/.ssh/known_hosts";
  if(-r $known_hosts && !$last_mtime
      || $last_mtime != stat($known_hosts)->mtime) {
    open my $fh, "<", $known_hosts or die "$known_hosts: $!";
    @hosts = map /^([^, ]+)/ ? $1 : (), <$fh>;
  }

  if(my $host = @args ? "@args"

 view all matches for this distribution


App-wordlist-blossom

 view release on metacpan or  search on metacpan

script/_wordlist-blossom  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


App-wordlist-wordle

 view release on metacpan or  search on metacpan

script/_wordlist-wordle  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


App-wordlist

 view release on metacpan or  search on metacpan

script/_wordlist  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


App-wordstat

 view release on metacpan or  search on metacpan

lib/App/wordstat.pm  view on Meta::CPAN


=head2 wordstat

Usage:

 wordstat(%args) -> [status, msg, payload, meta]

Return word statistics of a text.

Examples:

=over

=item * Example #1:

 wordstat(text => "An optimistic person sees good things everywhere, is generally confident and\nhopeful of what the future holds. From the optimist's point-of-view the world is\nfull of potential opportunities. The pessimist, on the other hand, obse...

Result:

 [
   200,

lib/App/wordstat.pm  view on Meta::CPAN

   },
 ]

=item * Supply text from file or stdin:

 wordstat( text => "file.txt");

=back

This function is not exported.

 view all matches for this distribution


App-wrapspeak

 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


App-wsgetmail

 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


App-zen

 view release on metacpan or  search on metacpan

bin/zen  view on Meta::CPAN

  return $ret;
}
sub load_zen_file
{
  my $filename = shift;
  my $st = stat($filename);
  my $mtime = $st->mtime;
  my $filesize = $st->size;

  open(my $fh, '<:encoding(UTF-8)', $filename)
    or die "Could not open file '$filename' $!";

bin/zen  view on Meta::CPAN

   # Should return  the data since last fetch offset.
  sub on_append_file {
    my ($cgi, $path) = @_;
    my $data = $cgi->param('POSTDATA');
    append_to_file($path, $data);
    my @stat_info = stat($path);
    if (@stat_info) {
      # Extract the last modification time
      my $mtime = $stat_info[9];
      print "HTTP/1.0 200 OK\r\n";
      print "Last-Modified: $mtime\r\n";

bin/zen  view on Meta::CPAN

    my $n = $cgi->url_param('n') || 0;
    my $last_mtime = $cgi->url_param('last_modified');
  
    if (-f $path) {
      # override require last_mtime
      my $stat = stat($path);
      my $mtime = $stat->mtime;
      if (!$last_mtime) {
        write_error(409, "Conflict", "Missing query parameter 'last_modified' l=$l");
        print Dumper $cgi;
        return;

bin/zen  view on Meta::CPAN

      write_file($path, $x.$data.$y);
    } else {
      print "HTTP/1.0 400 Bad request\r\n";
      return;
    }
    my $mtime = stat($path)->mtime;
    if ($mtime) {
      print "HTTP/1.0 200 OK\r\n";
      print "Last-Modified: $mtime\r\n";
      print "Content-Length: 0\r\n\r\n";
    } else {

bin/zen  view on Meta::CPAN

      while (<FH>) {
         print $_;
      }
      close FH;
    } elsif ($raw eq '1' && $l > 0) {
      my $mtime = stat($path)->mtime;
      print "HTTP/1.0 200 OK\r\n";
      print "Last-Modified: $mtime\r\n";
      print "Content-Type: text/plain\r\n\r\n";
      open my $fh, '<', $path or die "Can not open file: $!";
      while (<$fh>) {

bin/zen  view on Meta::CPAN

      close $fh;
    } else {
      my ($ext) = $path =~ /\.([^.]+)$/;
      my $mime_type = $mimeTypes{lc($ext)} || 'application/octet-stream';
      open my $fh, '<:raw', $path or die "Cannot open file: $!";
      my $mtime = stat($path)->mtime;
      my $filesize = -s $path;
      print "HTTP/1.1 200 OK\r\n";
      print "Content-Type: $mime_type\r\n";
      print "Last-Modified: $mtime\r\n";
      print "Content-Length: $filesize\r\n";

bin/zen  view on Meta::CPAN

    opendir(my $dh, $path) or die "Cannot open directory: $!";
    while (my $file = readdir $dh) {
      next if $file =~ /^\./;
      next if $file =~ /~$/;
      my $filepath = "$path/$file";
      my $mtime = stat($filepath)->mtime;
      push @contents, {
        name => -d $filepath ? "$file/" : $file,
        size => -s "$path/$file",
        mtime => $mtime,
      };

 view all matches for this distribution


Application-Config

 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


Apporo

 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


Arabic

 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


Arch

 view release on metacpan or  search on metacpan

perllib/Arch/Inventory.pm  view on Meta::CPAN


sub annotate_fs ($;$) {
	my $self = shift;

	if (@_) {
		$_[0]->{stat} = [ lstat("$self->{directory}/$_[0]->{path}") ];
		$_[0]->{symlink} = readlink("$self->{directory}/$_[0]->{path}")
			if $_[0]->{type} eq SYMLINK;
	} else {
		$self->foreach(sub { $self->annotate_fs($_[0]) });
	}

 view all matches for this distribution


Archive-Any-Plugin-Rar

 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


Archive-Ar-Libarchive

 view release on metacpan or  search on metacpan

lib/Archive/Ar/Libarchive.pm  view on Meta::CPAN

    unless(-r $filename)
    {
      $self->_error("No such file: $filename");
      next;
    }
    my @props = stat($filename);
    unless(@props)
    {
      $self->_error("Could not stat $filename.");
      next;
    }

 view all matches for this distribution


Archive-Ar

 view release on metacpan or  search on metacpan

lib/Archive/Ar.pm  view on Meta::CPAN

  $ar->add_files(@filenames)
  $ar->add_files($arrayref)

Adds files to the archive.  The arguments can be paths, but only the
filenames are stored in the archive.  Stores the uid, gid, mode, size,
and modification timestamp of the file as returned by C<stat()>.

Returns the number of files successfully added, or undef if failure.

=head2 add_data

 view all matches for this distribution


Archive-Builder

 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


Archive-ByteBoozer2

 view release on metacpan or  search on metacpan

file.c  view on Meta::CPAN

  FILE *fp = NULL;
  struct stat fileStatus;

  aFile->name = (char *)strdup(fileName);

  if(stat(aFile->name, &fileStatus) == -1) {
    return _false;
  }
  aFile->size = fileStatus.st_size;

  fp = fopen(aFile->name, "rb");

file.c  view on Meta::CPAN

  }

  strncpy(aFile->name, fileName, length);
  strncpy(aFile->name + length, ".b2\0", 4);

  if (stat(aFile->name, &st) == 0) {
    return _false;
  }

  fp = fopen(aFile->name, "wb");
  if(fp == NULL) {

 view all matches for this distribution


Archive-Chm

 view release on metacpan or  search on metacpan

Chm.pm  view on Meta::CPAN

// 	 Function that checks if the file/directory given as an argument exists.
//------------------------------------------------------------------------------*/
static int _dir_exists(const char *path)
{
    struct stat statbuf;
    if (stat(path, &statbuf) != -1)
    	return 1;
    else
    	return 0;
}

 view all matches for this distribution


( run in 3.564 seconds using v1.01-cache-2.11-cpan-804bf51f3ce )