I am playing around with php rar
http://www.php.net/manual/en/intro.rar.php
Goal :
Gather file (name) information of multi volume rar archives, from only the first volume.
Example :
Complete volume :
testArchive.rar ,
testArchive.r00
Available : testArchive.rar
Scan files inside archive from testArchive.rar WITHOUT testArchive.r00
Winrar ( rarlabs.com ) gives you the archived (file) content of the multi volume rar archive from the first volume.
Now I want this accomplished by php.
I tried the following but this gives me an empty array.
function retnull() { return null; }
$arch = RarArchive::open("testArchive.rar" , NULL , 'retnull' );
$arch->setAllowBroken(true);
if ($arch === FALSE)
die("Cannot open testArchive.rar");
$entries = $arch->getEntries();
if ($entries === FALSE)
die("Cannot retrieve entries");
echo '<pre>';
print_r($entries);
echo '</pre>';
I do not need to extract the rar files , but only need the content [NAMES] of the folders/files inside the archive like the program winrar does.
Can somebody give me a hint in the right direction ?
Found a solution to my own problem.
Install UnRar http://www.win-rar.com/rarextras.html
( I am using CentOS : yum install unrar )
This will give you the following output:
After that just write a class to retrieve the information you need with reg-patterns or substr.