Sponsored Content
Full Discussion: Rar files
Top Forums UNIX for Beginners Questions & Answers Rar files Post 303036864 by abdossamad2003 on Monday 15th of July 2019 04:21:45 AM
Old 07-15-2019
Rar files

hi unix expert
is there any program in linux to compress files or directory with rar (.rar)?
i am using centos 7


many thanks
samad
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extracting .rar files

Hi, Can someone throw light on opening a .rar file? thanks, sskb (5 Replies)
Discussion started by: sskb
5 Replies

2. UNIX for Dummies Questions & Answers

how to extract a .rar file

Hi ! I have a abc.rar file. I want to extract this file.. pls help. OS Details : SunOS papillon 5.10 Generic_127111-11 sun4us sparc FJSV,GPUZC-M (1 Reply)
Discussion started by: dashok.83
1 Replies

3. UNIX for Dummies Questions & Answers

How can i open rar files

Is there a way to open rar files on linux i would really appretiate if u would help :) (2 Replies)
Discussion started by: abu_malek
2 Replies

4. UNIX for Dummies Questions & Answers

extract rar/zip files from pc DIRECTLY on xbox (FTP)

Hello I've an old xbox connected to Ubuntu 8.04 with an ethernet cable. I use gFTP to transfer files on xbox (through FTP). When I have to transfer a rar file, first of all I have to extract it on ubuntu, then on xbox. I would like to transfer rar files directly on xbox. Is it possible with... (4 Replies)
Discussion started by: paolobitta
4 Replies

5. Red Hat

How to open RAR files?

May be this is a newbie question but i want to know hoe to open the RAR file in linux? (1 Reply)
Discussion started by: ashok.g
1 Replies

6. UNIX for Dummies Questions & Answers

Help with rar

Hi UNIX experts, I am stuck on a task due to ignorance with bash and all those commands. I have thousand of split archive files on a folder called downloads Each file is named as below: 0001.part1.rar 0001.part2.rar 0001.part3.rar 0002.part1.rar 0002.part2.rar 0003.par1.rar... (5 Replies)
Discussion started by: farneville
5 Replies

7. Shell Programming and Scripting

Searching for a string in .PDF files inside .RAR & .ZIP archives.

Hi, I have got a large number of .PDF files that are archived in .RAR & ZIP files in various directories and I would like to search for strings inside the PDF files. I would think you would need something that can recursively read directories, extract the .RAR/.ZIP file in memory, read the... (3 Replies)
Discussion started by: lewk
3 Replies

8. Solaris

Extract .rar format files in Solaris

Hi All, Is there way to extract the .rar format files in Solaris Thanks, Mani Muthu (3 Replies)
Discussion started by: k_manimuthu
3 Replies

9. Red Hat

Extract .rar format files in Red Hat

Hi All, Is there way to extract the .rar format files in red hat server. Thanks, Mani Muthu (1 Reply)
Discussion started by: k_manimuthu
1 Replies

10. UNIX for Dummies Questions & Answers

Unzip a .rar file

Hi, How to unzip a .rar file in unix. I tried unrar command but it doesnt work. Any help will be appreciated Thanks (10 Replies)
Discussion started by: irudayaraj
10 Replies
RAR_OPEN(3)								 1							       RAR_OPEN(3)

RarArchive::open - Open RAR archive

       Object oriented style (method):

SYNOPSIS
publicstatic RarArchive RarArchive::open (string $filename, [string $password = NULL], [callable $volume_callback = NULL]) DESCRIPTION
Procedural style: RarArchive rar_open (string $filename, [string $password = NULL], [callable $volume_callback = NULL]) Open specified RAR archive and return RarArchive instance representing it. Note If opening a multi-volume archive, the path of the first volume should be passed as the first parameter. Otherwise, not all files will be shown. This is by design. PARAMETERS
o $filename - Path to the Rar archive. o $password - A plain password, if needed to decrypt the headers. It will also be used by default if encrypted files are found. Note that the files may have different passwords in respect to the headers and among them. o $volume_callback - A function that receives one parameter - the path of the volume that was not found - and returns a string with the correct path for such volume or NULL if such volume does not exist or is not known. The programmer should ensure the passed function doesn't cause loops as this function is called repeatedly if the path returned in a previous call did not correspond to the needed volume. Specifying this parameter omits the notice that would otherwise be emitted whenever a volume is not found; an implementation that only returns NULL can therefore be used to merely omit such notices. Warning Prior to version 2.0.0, this function would not handle relative paths correctly. Use realpath(3) as a workaround. RETURN VALUES
Returns the requested RarArchive instance or FALSE on failure. CHANGELOG
+--------+-----------------------------+ |Version | | | | | | | Description | | | | +--------+-----------------------------+ | 3.0.0 | | | | | | | $volume_callback was added. | | | | +--------+-----------------------------+ EXAMPLES
Example #1 Object oriented style <?php $rar_arch = RarArchive::open('encrypted_headers.rar', 'samplepassword'); if ($rar_arch === FALSE) die("Failed opening file"); $entries = $rar_arch->getEntries(); if ($entries === FALSE) die("Failed fetching entries"); echo "Found " . count($entries) . " files. "; if (empty($entries)) die("No valid entries found."); $stream = reset($entries)->getStream(); if ($stream === FALSE) die("Failed opening first file"); $rar_arch->close(); echo "Content of first one follows: "; echo stream_get_contents($stream); fclose($stream); ?> The above example will output something similar to: Found 2 files. Content of first one follows: Encrypted file 1 contents. Example #2 Procedural style <?php $rar_arch = rar_open('encrypted_headers.rar', 'samplepassword'); if ($rar_arch === FALSE) die("Failed opening file"); $entries = rar_list($rar_arch); if ($entries === FALSE) die("Failed fetching entries"); echo "Found " . count($entries) . " files. "; if (empty($entries)) die("No valid entries found."); $stream = reset($entries)->getStream(); if ($stream === FALSE) die("Failed opening first file"); rar_close($rar_arch); echo "Content of first one follows: "; echo stream_get_contents($stream); fclose($stream); ?> Example #3 Volume Callback <?php /* In this example, there's a volume named multi_broken.part1.rar * whose next volume is named multi.part2.rar */ function resolve($vol) { if (preg_match('/_broken/', $vol)) return str_replace('_broken', '', $vol); else return null; } $rar_file1 = rar_open(dirname(__FILE__).'/multi_broken.part1.rar', null, 'resolve'); $entry = $rar_file1->getEntry('file2.txt'); $entry->extract(null, dirname(__FILE__) . "/temp_file2.txt"); ?> SEE ALSO
rar:// wrapper. PHP Documentation Group RAR_OPEN(3)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy