Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > e1011ddec34cda34f3a002b121247943 > files > 831

python-docs-2.7.17-1.1.mga7.noarch.rpm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>37.3. macostools — Convenience routines for file manipulation &#8212; Python 2.7.17 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>
    
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 2.7.17 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="next" title="37.5. EasyDialogs — Basic Macintosh dialogs" href="easydialogs.html" />
    <link rel="prev" title="37.2. MacOS — Access to Mac OS interpreter features" href="macos.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <link rel="canonical" href="https://docs.python.org/2/library/macostools.html" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </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="easydialogs.html" title="37.5. EasyDialogs — Basic Macintosh dialogs"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="macos.html" title="37.2. MacOS — Access to Mac OS interpreter features"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="mac.html" accesskey="U">37. Mac OS X specific services</a> &#187;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-macostools">
<span id="macostools-convenience-routines-for-file-manipulation"></span><h1>37.3. <a class="reference internal" href="#module-macostools" title="macostools: Convenience routines for file manipulation. (deprecated) (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">macostools</span></code></a> — Convenience routines for file manipulation<a class="headerlink" href="#module-macostools" title="Permalink to this headline">¶</a></h1>
<p>This module contains some convenience routines for file-manipulation on the
Macintosh. All file parameters can be specified as pathnames, <code class="xref py py-class docutils literal notranslate"><span class="pre">FSRef</span></code> or
<code class="xref py py-class docutils literal notranslate"><span class="pre">FSSpec</span></code> objects.  This module expects a filesystem which supports forked
files, so it should not be used on UFS partitions.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This module has been removed in Python 3.</p>
</div>
<p>The <a class="reference internal" href="#module-macostools" title="macostools: Convenience routines for file manipulation. (deprecated) (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">macostools</span></code></a> module defines the following functions:</p>
<dl class="function">
<dt id="macostools.copy">
<code class="descclassname">macostools.</code><code class="descname">copy</code><span class="sig-paren">(</span><em>src</em>, <em>dst</em><span class="optional">[</span>, <em>createpath</em><span class="optional">[</span>, <em>copytimes</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#macostools.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy file <em>src</em> to <em>dst</em>.  If <em>createpath</em> is non-zero the folders leading to
<em>dst</em> are created if necessary. The method copies data and resource fork and
some finder information (creator, type, flags) and optionally the creation,
modification and backup times (default is to copy them). Custom icons, comments
and icon position are not copied.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This function does not work in 64-bit code because it uses APIs that
are not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="macostools.copytree">
<code class="descclassname">macostools.</code><code class="descname">copytree</code><span class="sig-paren">(</span><em>src</em>, <em>dst</em><span class="sig-paren">)</span><a class="headerlink" href="#macostools.copytree" title="Permalink to this definition">¶</a></dt>
<dd><p>Recursively copy a file tree from <em>src</em> to <em>dst</em>, creating folders as needed.
<em>src</em> and <em>dst</em> should be specified as pathnames.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This function does not work in 64-bit code because it uses APIs that
are not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="macostools.mkalias">
<code class="descclassname">macostools.</code><code class="descname">mkalias</code><span class="sig-paren">(</span><em>src</em>, <em>dst</em><span class="sig-paren">)</span><a class="headerlink" href="#macostools.mkalias" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a finder alias <em>dst</em> pointing to <em>src</em>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This function does not work in 64-bit code because it uses APIs that
are not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="macostools.touched">
<code class="descclassname">macostools.</code><code class="descname">touched</code><span class="sig-paren">(</span><em>dst</em><span class="sig-paren">)</span><a class="headerlink" href="#macostools.touched" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder that some bits of finder-information such as creator or type for
file <em>dst</em> has changed. The file can be specified by pathname or fsspec. This
call should tell the finder to redraw the files icon.</p>
<div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 2.6: </span>The function is a no-op on OS X.</p>
</div>
</dd></dl>

<dl class="data">
<dt id="macostools.BUFSIZ">
<code class="descclassname">macostools.</code><code class="descname">BUFSIZ</code><a class="headerlink" href="#macostools.BUFSIZ" title="Permalink to this definition">¶</a></dt>
<dd><p>The buffer size for <code class="docutils literal notranslate"><span class="pre">copy</span></code>, default 1 megabyte.</p>
</dd></dl>

<p>Note that the process of creating finder aliases is not specified in the Apple
documentation. Hence, aliases created with <a class="reference internal" href="#macostools.mkalias" title="macostools.mkalias"><code class="xref py py-func docutils literal notranslate"><span class="pre">mkalias()</span></code></a> could conceivably
have incompatible behaviour in some cases.</p>
</div>
<div class="section" id="module-findertools">
<span id="findertools-the-finder-s-apple-events-interface"></span><h1>37.4. <a class="reference internal" href="#module-findertools" title="findertools: Wrappers around the finder's Apple Events interface. (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">findertools</span></code></a> — The <strong class="program">finder</strong>’s Apple Events interface<a class="headerlink" href="#module-findertools" title="Permalink to this headline">¶</a></h1>
<p id="index-0">This module contains routines that give Python programs access to some
functionality provided by the finder. They are implemented as wrappers around
the AppleEvent interface to the finder.</p>
<p>All file and folder parameters can be specified either as full pathnames, or as
<code class="xref py py-class docutils literal notranslate"><span class="pre">FSRef</span></code> or <code class="xref py py-class docutils literal notranslate"><span class="pre">FSSpec</span></code> objects.</p>
<p>The <a class="reference internal" href="#module-findertools" title="findertools: Wrappers around the finder's Apple Events interface. (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">findertools</span></code></a> module defines the following functions:</p>
<dl class="function">
<dt id="findertools.launch">
<code class="descclassname">findertools.</code><code class="descname">launch</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="headerlink" href="#findertools.launch" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to launch <em>file</em>. What launching means depends on the file:
applications are started, folders are opened and documents are opened in the
correct application.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.Print">
<code class="descclassname">findertools.</code><code class="descname">Print</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="headerlink" href="#findertools.Print" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to print a file. The behaviour is identical to selecting the
file and using the print command in the finder’s file menu.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.copy">
<code class="descclassname">findertools.</code><code class="descname">copy</code><span class="sig-paren">(</span><em>file</em>, <em>destdir</em><span class="sig-paren">)</span><a class="headerlink" href="#findertools.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to copy a file or folder <em>file</em> to folder <em>destdir</em>. The
function returns an <code class="xref py py-class docutils literal notranslate"><span class="pre">Alias</span></code> object pointing to the new file.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.move">
<code class="descclassname">findertools.</code><code class="descname">move</code><span class="sig-paren">(</span><em>file</em>, <em>destdir</em><span class="sig-paren">)</span><a class="headerlink" href="#findertools.move" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to move a file or folder <em>file</em> to folder <em>destdir</em>. The
function returns an <code class="xref py py-class docutils literal notranslate"><span class="pre">Alias</span></code> object pointing to the new file.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.sleep">
<code class="descclassname">findertools.</code><code class="descname">sleep</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#findertools.sleep" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to put the Macintosh to sleep, if your machine supports it.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.restart">
<code class="descclassname">findertools.</code><code class="descname">restart</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#findertools.restart" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to perform an orderly restart of the machine.</p>
</dd></dl>

<dl class="function">
<dt id="findertools.shutdown">
<code class="descclassname">findertools.</code><code class="descname">shutdown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#findertools.shutdown" title="Permalink to this definition">¶</a></dt>
<dd><p>Tell the finder to perform an orderly shutdown of the machine.</p>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">37.3. <code class="xref py py-mod docutils literal notranslate"><span class="pre">macostools</span></code> — Convenience routines for file manipulation</a></li>
<li><a class="reference internal" href="#module-findertools">37.4. <code class="xref py py-mod docutils literal notranslate"><span class="pre">findertools</span></code> — The <strong class="program">finder</strong>’s Apple Events interface</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="macos.html"
                        title="previous chapter">37.2. <code class="xref py py-mod docutils literal notranslate"><span class="pre">MacOS</span></code> — Access to Mac OS interpreter features</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="easydialogs.html"
                        title="next chapter">37.5. <code class="xref py py-mod docutils literal notranslate"><span class="pre">EasyDialogs</span></code> — Basic Macintosh dialogs</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/library/macostools.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" />
    </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="easydialogs.html" title="37.5. EasyDialogs — Basic Macintosh dialogs"
             >next</a> |</li>
        <li class="right" >
          <a href="macos.html" title="37.2. MacOS — Access to Mac OS interpreter features"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="mac.html" >37. Mac OS X specific services</a> &#187;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Oct 19, 2019.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.0.1.
    </div>

  </body>
</html>