Skip to content

Commit

Permalink
Merge pull request #51 from mcdruid/fix_big_files
Browse files Browse the repository at this point in the history
big file support
  • Loading branch information
ashnazg authored Nov 24, 2024
2 parents 4a67cbc + 3abb0c2 commit 3677851
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function __construct($p_tarname, $p_compress = null, $buffer_length = 512
"a8checksum/a1typeflag/a100link/a6magic/a2version/" .
"a32uname/a32gname/a8devmajor/a8devminor/a131prefix";
} else {
$this->_fmt = "Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/" .
$this->_fmt = "Z100filename/Z8mode/Z8uid/Z8gid/a12size/Z12mtime/" .
"Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/" .
"Z32uname/Z32gname/Z8devmajor/Z8devminor/Z131prefix";
}
Expand Down
21 changes: 21 additions & 0 deletions tests/big.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
tests if files > 8G are supported
--SKIPIF--
--FILE--
<?php
require_once dirname(__FILE__) . '/setup.php.inc';
$tar = new Archive_Tar(dirname(__FILE__) . '/big.tar.bz2');
$content = $tar->listContent();
$found_big_file = false;
foreach ($content as $item) {
if ($item['filename'] === 'big_archive/8.5G_file') {
$found_big_file = true;
$phpunit->assertEquals(9126805504, $item['size'], 'size of big file correct');
}
}
$phpunit->assertTrue($found_big_file, 'found the big file in the archive');
echo 'tests done';
?>
--CLEAN--
--EXPECT--
tests done
Binary file added tests/big.tar.bz2
Binary file not shown.

0 comments on commit 3677851

Please # to comment.