Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 74621034535346a27cf89ad32f2b352c > files > 45

python2-rarfile-3.0-3.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>rarfile FAQ &#8212; RarFile 3.0 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="rarfile history" href="news.html" />
    <link rel="prev" title="rarfile API documentation" href="api.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="news.html" title="rarfile history"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="api.html" title="rarfile API documentation"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">RarFile 3.0 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="rarfile-faq">
<h1><a class="toc-backref" href="#id1">rarfile FAQ</a><a class="headerlink" href="#rarfile-faq" title="Permalink to this headline">¶</a></h1>
<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#rarfile-faq" id="id1">rarfile FAQ</a><ul>
<li><a class="reference internal" href="#what-are-the-dependencies" id="id2">What are the dependencies?</a></li>
<li><a class="reference internal" href="#does-it-parse-unrar-output-to-get-archive-contents" id="id3">Does it parse <code class="docutils literal notranslate"><span class="pre">unrar</span></code> output to get archive contents?</a></li>
<li><a class="reference internal" href="#will-rarfile-support-wrapping-unrarlib-unrar-dll-unrar-so-in-the-future" id="id4">Will rarfile support wrapping unrarlib/unrar.dll/unrar.so in the future?</a></li>
<li><a class="reference internal" href="#how-can-i-get-it-work-on-windows" id="id5">How can I get it work on Windows?</a></li>
<li><a class="reference internal" href="#how-to-avoid-the-need-for-user-to-manually-install-rarfile-unrar" id="id6">How to avoid the need for user to manually install rarfile/unrar?</a></li>
<li><a class="reference internal" href="#will-it-support-creating-rar-archives" id="id7">Will it support creating RAR archives?</a></li>
<li><a class="reference internal" href="#what-is-the-use-extract-hack" id="id8">What is the USE_EXTRACT_HACK?</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="what-are-the-dependencies">
<h2><a class="toc-backref" href="#id2">What are the dependencies?</a><a class="headerlink" href="#what-are-the-dependencies" title="Permalink to this headline">¶</a></h2>
<p>It depends on <code class="docutils literal notranslate"><span class="pre">unrar</span></code> command-line utility to do the actual decompression.
Note that by default it expect it to be in <code class="docutils literal notranslate"><span class="pre">PATH</span></code>.  If unrar
launching fails, you need to fix this.</p>
<p>Alternatively, <a class="reference internal" href="api.html#module-rarfile" title="rarfile"><code class="xref py py-mod docutils literal notranslate"><span class="pre">rarfile</span></code></a> can use <a class="reference external" href="https://github.com/libarchive/libarchive/wiki/ManPageBsdtar1">bsdtar</a> from <a class="reference external" href="http://www.libarchive.org/">libarchive</a> as
decompression backend, but that is a bit problematic as <a class="reference external" href="https://github.com/libarchive/libarchive/wiki/ManPageBsdtar1">bsdtar</a> does not support
all RAR features.</p>
<p>It depends on <a class="reference external" href="https://pypi.python.org/pypi/cryptography">cryptography</a> or <a class="reference external" href="https://pypi.python.org/pypi/pycrypto">PyCrypto</a> modules to process
archives with password-protected headers.</p>
</div>
<div class="section" id="does-it-parse-unrar-output-to-get-archive-contents">
<h2><a class="toc-backref" href="#id3">Does it parse <code class="docutils literal notranslate"><span class="pre">unrar</span></code> output to get archive contents?</a><a class="headerlink" href="#does-it-parse-unrar-output-to-get-archive-contents" title="Permalink to this headline">¶</a></h2>
<p>No, <a class="reference internal" href="api.html#module-rarfile" title="rarfile"><code class="xref py py-mod docutils literal notranslate"><span class="pre">rarfile</span></code></a> parses RAR structure in Python code.  Also it can
read uncompressed files from archive without external utility.</p>
</div>
<div class="section" id="will-rarfile-support-wrapping-unrarlib-unrar-dll-unrar-so-in-the-future">
<h2><a class="toc-backref" href="#id4">Will rarfile support wrapping unrarlib/unrar.dll/unrar.so in the future?</a><a class="headerlink" href="#will-rarfile-support-wrapping-unrarlib-unrar-dll-unrar-so-in-the-future" title="Permalink to this headline">¶</a></h2>
<p>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.</p>
<p>Simple execution of command-line tools is also legally simpler situation
than linking with external library.</p>
</div>
<div class="section" id="how-can-i-get-it-work-on-windows">
<h2><a class="toc-backref" href="#id5">How can I get it work on Windows?</a><a class="headerlink" href="#how-can-i-get-it-work-on-windows" title="Permalink to this headline">¶</a></h2>
<p>On Windows the <code class="docutils literal notranslate"><span class="pre">unrar.exe</span></code> is not in <code class="docutils literal notranslate"><span class="pre">PATH</span></code> so simple <code class="docutils literal notranslate"><span class="pre">Popen(&quot;unrar</span> <span class="pre">..&quot;)</span></code> does not work.
It can be solved several ways:</p>
<ol class="arabic simple">
<li>Add location of <code class="docutils literal notranslate"><span class="pre">unrar.exe</span></code> to PATH.</li>
<li>Set <a class="reference internal" href="api.html#rarfile.UNRAR_TOOL" title="rarfile.UNRAR_TOOL"><code class="xref py py-data docutils literal notranslate"><span class="pre">rarfile.UNRAR_TOOL</span></code></a> to full path of <code class="docutils literal notranslate"><span class="pre">unrar.exe</span></code>.</li>
<li>Copy <code class="docutils literal notranslate"><span class="pre">unrar.exe</span></code> to your program directory.</li>
<li>Copy <code class="docutils literal notranslate"><span class="pre">unrar.exe</span></code> to system directory that is in PATH, eg. <code class="docutils literal notranslate"><span class="pre">C:\Windows</span></code>.</li>
</ol>
</div>
<div class="section" id="how-to-avoid-the-need-for-user-to-manually-install-rarfile-unrar">
<h2><a class="toc-backref" href="#id6">How to avoid the need for user to manually install rarfile/unrar?</a><a class="headerlink" href="#how-to-avoid-the-need-for-user-to-manually-install-rarfile-unrar" title="Permalink to this headline">¶</a></h2>
<p>Include <code class="docutils literal notranslate"><span class="pre">rarfile.py</span></code> and/or <code class="docutils literal notranslate"><span class="pre">unrar</span></code> with your application.</p>
</div>
<div class="section" id="will-it-support-creating-rar-archives">
<h2><a class="toc-backref" href="#id7">Will it support creating RAR archives?</a><a class="headerlink" href="#will-it-support-creating-rar-archives" title="Permalink to this headline">¶</a></h2>
<p>No.  <a class="reference external" href="http://www.rarlab.com/">RARLAB</a> is not interested in RAR becoming open format
and specifically discourages writing RAR creation software.</p>
<p>In the meantime use either <a class="reference external" href="https://en.wikipedia.org/wiki/ZIP_%28file_format%29">Zip</a> (better compatibility) or <a class="reference external" href="https://en.wikipedia.org/wiki/7z">7z</a> (better compression)
format for your own archives.</p>
</div>
<div class="section" id="what-is-the-use-extract-hack">
<h2><a class="toc-backref" href="#id8">What is the USE_EXTRACT_HACK?</a><a class="headerlink" href="#what-is-the-use-extract-hack" title="Permalink to this headline">¶</a></h2>
<p>RarFile uses <code class="docutils literal notranslate"><span class="pre">unrar</span></code> to extract compressed files.  But when extracting
single file from archive containing many entries, <code class="docutils literal notranslate"><span class="pre">unrar</span></code> 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 <code class="docutils literal notranslate"><span class="pre">unrar</span></code> fast.</p>
<p>The logic is only activated for entries smaller than <a class="reference internal" href="api.html#rarfile.HACK_SIZE_LIMIT" title="rarfile.HACK_SIZE_LIMIT"><code class="xref py py-data docutils literal notranslate"><span class="pre">rarfile.HACK_SIZE_LIMIT</span></code></a>
(20M by default).  Bigger files are accessed directly from RAR.</p>
<p>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.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">rarfile FAQ</a><ul>
<li><a class="reference internal" href="#what-are-the-dependencies">What are the dependencies?</a></li>
<li><a class="reference internal" href="#does-it-parse-unrar-output-to-get-archive-contents">Does it parse <code class="docutils literal notranslate"><span class="pre">unrar</span></code> output to get archive contents?</a></li>
<li><a class="reference internal" href="#will-rarfile-support-wrapping-unrarlib-unrar-dll-unrar-so-in-the-future">Will rarfile support wrapping unrarlib/unrar.dll/unrar.so in the future?</a></li>
<li><a class="reference internal" href="#how-can-i-get-it-work-on-windows">How can I get it work on Windows?</a></li>
<li><a class="reference internal" href="#how-to-avoid-the-need-for-user-to-manually-install-rarfile-unrar">How to avoid the need for user to manually install rarfile/unrar?</a></li>
<li><a class="reference internal" href="#will-it-support-creating-rar-archives">Will it support creating RAR archives?</a></li>
<li><a class="reference internal" href="#what-is-the-use-extract-hack">What is the USE_EXTRACT_HACK?</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="api.html"
                        title="previous chapter">rarfile API documentation</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="news.html"
                        title="next chapter">rarfile history</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/faq.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="news.html" title="rarfile history"
             >next</a> |</li>
        <li class="right" >
          <a href="api.html" title="rarfile API documentation"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">RarFile 3.0 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2005-2016, Marko Kreen.
    </div>
  </body>
</html>