Affix

 view release on metacpan or  search on metacpan

builder/Affix.pm  view on Meta::CPAN

    for ( my $status = 1; $status > 0; $status = $u->nextStream() ) {
        last if $status < 0;    # bail on error
        my $header = $u->getHeaderInfo();

        #ddx $header;
        my $destfile = $dest->child( $header->{Name} );
        next if $header->{Name} =~ m[/$];    # Directory
        next if $destfile->is_dir;
        next
            if $destfile->is_file &&
            stat( $destfile->absolute->stringify )->mtime < $header->{Time};
        warn $destfile;
        $destfile->parent->mkpath;
        my $raw = '';
        while ( ( $status = $u->read( my $buff ) ) > 0 ) { $raw .= $buff }
        $destfile->spew_raw($raw);
        $destfile->touch;
        $retval = $destfile->parent if $destfile =~ 'build.log';
    }
    return $retval;
}

dyncall/dynload/dynload_syms_elf.c  view on Meta::CPAN



DLSyms* dlSymsInit(const char* libPath)
{
  unsigned char* pMem;
  int i;
  struct stat st;
  Elf_Shdr* pS;
  DLSyms* pSyms;

  if(stat(libPath, &st) == -1)
    return NULL;

  i = open(libPath, O_RDONLY);
  if(i == -1)
    return NULL;

  pSyms = (DLSyms*)dlAllocMem(sizeof(DLSyms));
  memset(pSyms, 0, sizeof(DLSyms));
  pSyms->file = i;
  pSyms->fileSize = st.st_size;

dyncall/test/dynload_plain/dynload_plain.c  view on Meta::CPAN

      r += (p != NULL);

      bs = dlGetLibraryPath(pLib, queriedPath, 200);
      if(bs && bs <= 200) {
        int b, bs_;
        printf("path of lib looked up via handle: %s\n", queriedPath);

/*@@@ check if resolved path is absolute*/

#if defined(DC_WINDOWS)
        /* on windows, inode numbers returned by stat(2) tests below are always 0, so don't use those */
        cmp_inode = 0;
#endif

        /* path based check if same lib */
        if(cmp_inode)
        {
          struct stat st0, st1; /* to check if same file */
          b = (stat(path, &st0) != -1) && (stat(queriedPath, &st1) != -1);
          printf("lib (inode:%d) and looked up lib (inode:%d) are same: %d\n", b?(int)st0.st_ino:-1, b?(int)st1.st_ino:-1, b && (st0.st_ino == st1.st_ino));
          r += b && (st0.st_ino == st1.st_ino); /* compare if same lib using inode */
        }
        else
          printf("-- skipping inode based check (doesn't apply to this platform or we are dealing with macos dylib that isn't on fs) --\n");

        /* just load lib with queried path and compare handle */
        {
          DLLib* pLib_ = dlLoadLibrary(queriedPath);
          b = (pLib == pLib_); /* pLib guaranteed to not be NULL, here, so no explicit !pLib_ check */



( run in 0.473 second using v1.01-cache-2.11-cpan-49f99fa48dc )