Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:48:42+00:00 2026-05-30T20:48:42+00:00

I am playing around with php rar http://www.php.net/manual/en/intro.rar.php Goal : Gather file (name) information

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:48:43+00:00Added an answer on May 30, 2026 at 8:48 pm

    Found a solution to my own problem.

    Install UnRar http://www.win-rar.com/rarextras.html
    ( I am using CentOS : yum install unrar )

       <?php
    
        $path   ='/path/to/archiveFolder/';
        $archive='testArchive.rar';
    
        $var =exec('unrar l -p- '.escapeshellarg($path.$archive),$file_output);
    
        echo '<pre>';
            print_r($file_output);
        echo '</pre>';
    
        ?>
    

    This will give you the following output:

    Array
    (
        [0] => 
        [1] => UNRAR 4.10 freeware      Copyright (c) 1993-2012 Alexander Roshal
        [2] => 
        [3] => Volume path/to/archiveFolder/testArchive.rar
        [4] => 
        [5] =>  Name             Size   Packed Ratio  Date   Time     Attr      CRC   Meth Ver
        [6] => -------------------------------------------------------------------------------
        [7] =>  testfile.mkv 1699997366 49999891  --> 19-02-12 21:05  .....A.   95E20DA9 m0g 2.0
        [8] => -------------------------------------------------------------------------------
        [9] =>     1       1699997366 49999891   2%       volume 1
        [10] => 
    )
    

    After that just write a class to retrieve the information you need with reg-patterns or substr.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am playing around with an xml file found @ http://www.jsphylosvg.com/examples/source.php?example=2&t=xml I would like
I am playing around with this page: http://www.problemio.com/problems/problem.php?problem_id=228 To reproduce the problem, log in
I saw a post earlier today and have been playing around with: http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html What
I'm playing around with encrypt/decrypt coding in php. Interesting stuff! However, I'm coming across
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
So im just playing around with PHP and the MD5 functionality, sorry if this
I have been playing around in PHP with it and got something to work,
I have been playing around with php-gtk recently and in the past I have
I'm just playing around with some PHP and was wondering what happens when an
iam playing around with OPEN CV from Intel with the associated PHP Extensions. Works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.