Table of Contents
- rarfile FAQ
- What are the dependencies?
- Does it parse
unraroutput to get archive contents?
- Will rarfile support wrapping unrarlib/unrar.dll/unrar.so in the future?
- How can I get it work on Windows?
- How to avoid the need for user to manually install rarfile/unrar?
- Will it support creating RAR archives?
- What is the USE_EXTRACT_HACK?
It depends on
unrar command-line utility to do the actual decompression.
Note that by default it expect it to be in
PATH. If unrar
launching fails, you need to fix this.
rarfile parses RAR structure in Python code. Also it can
read uncompressed files from archive without external utility.
No. The current architecture - parsing in Python and decompression with command line tools work well across all interesting operating systems (Windows/Linux/MacOS), wrapping a library does not bring any advantages.
Simple execution of command-line tools is also legally simpler situation than linking with external library.
On Windows the
unrar.exe is not in
PATH so simple
Popen("unrar ..") does not work.
It can be solved several ways:
- Add location of
rarfile.UNRAR_TOOLto full path of
unrar.exeto your program directory.
unrar.exeto system directory that is in PATH, eg.
unrar with your application.
No. RARLAB is not interested in RAR becoming open format and specifically discourages writing RAR creation software.
unrar to extract compressed files. But when extracting
single file from archive containing many entries,
unrar needs to parse
whole archive until it finds the right entry. This makes random-access
to entries slow. To avoid that, RarFile remembers location of compressed
data for each entry and on read it copies it to temporary archive containing
only data for that one file, thus making
The logic is only activated for entries smaller than
(20M by default). Bigger files are accessed directly from RAR.
Note - it only works for non-solid archives. So if you care about random access to files in your archive, do not create solid archives.