RAR (.rar)
- Import fully supports the RAR4 and RAR5 formats.
- Import can work with general RAR archives, as well as with specific application formats consisting of multiple related files.
Background & Context
-
- Registered MIME type: application/vnd.rar
- Data compression and archival format.
- Used to reduce storage space and transfer times.
- Binary format.
- Can contain multiple files.
- Supports a variety of compression methods.
- Originally developed by Eugene Roshal in 1993.
- RAR is an acronym for Roshal Archive.
- Maintained by win.rar GmbH.
Import
- When importing files from a RAR archive, the specific converter for each format will be used.
- Import["file.rar"] returns an expression of the form {"fn1", "fn2",…}, giving full path specifications for all files in "file.rar".
- Import["file.rar",elem] imports the specified element from a RAR file.
- Import["file.rar","fn"] extracts "fn" from the archive and imports it.
- Import["file.rar",{elem,suba,subb,…}] imports a subelement.
- Import["file.rar",{{elem1,elem2,…}}] imports multiple elements.
- Import["file","RAR"] or Import["file",{"RAR",elem,…}] imports any file as a RAR archive.
- See the following reference pages for full general information:
-
Import import from a file CloudImport import from a cloud object ImportString import from a string ImportByteArray import from a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - The following can be used to select or specify individual files in a RAR archive:
-
"FileNames" list of filenames representing the contents of a RAR archive "filename" a single file "filename","format" a single file, taken to be in the specified format "filename","format",elem element elem from the specified file - Import by default uses the "FileNames" element for the RAR format.
- Import["file.rar","fn"] extracts and imports file "fn".
- File names can include relative or absolute directory specifications and the abbreviated string patterns supported by StringMatchQ.
- Import["file.rar","*"] imports an entire archive.
- Import["file.rar","dir/*.jpg"] imports all JPEG files from subdirectory dir.