App-zipdetails

 view release on metacpan or  search on metacpan

bin/zipdetails  view on Meta::CPAN

        if $cdOffset < 44 || $FILELEN - $cdSize < 44 ;

    # Step 1 - 16 bytes before CD is literal string "APK Sig Block 42"
    my $magicOffset = $cdOffset - 16;
    my $buffer = readFromOffset($magicOffset, 16);

    return (0, 0, '')
        if $buffer ne "APK Sig Block 42" ;

    # Step 2 - read the second length field
    #          and check that it looks ok
    $buffer = readFromOffset($cdOffset - 16 - 8, 8);
    my $len2 = unpack("Q<", $buffer);

    return (0, 0, '')
        if $len2 == 0 || $len2 > $FILELEN;

    # Step 3 - read the first length field.
    #          It should be identical to the second one.

    my $startApkOffset = $cdOffset -  8 - $len2 ;

t/002-main.t  view on Meta::CPAN

        my $z = $dirs{$dir};
        my $zipfile = "$dir/$z";

        if (defined $ENV{ZIPDETAILS_TEST_MATCH})
        {
            # skip "Test '$dir' doesn't match ZIPDETAILS_TEST_MATCH/" . basename($zipfile), $tests_per_zip_full
            next
                unless $zipfile =~ /$ENV{ZIPDETAILS_TEST_MATCH}/;
        }

        # these tests fail - looks like a FORMAT issue
        skip "skipping", $tests_per_zip_full
            if $zipfile =~ m<0000-errors/encoding/bad-encode> && $] < 5.020;

        if ($z =~ /zst$/)
        {
            skip "ZSTD not available for test $dir/" . basename($zipfile), $tests_per_zip_full
                if ! $ZSTD;

            chdir $tempdir
                or die "cannot chdir: $!\n";



( run in 0.369 second using v1.01-cache-2.11-cpan-607d282f910 )