1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<html xmlns="http://www.w3.org/1999/xhtml">
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<title>10. File and Directory Access — Python 2.7.12 documentation</title>
11
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
12
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
14
<script type="text/javascript">
15
var DOCUMENTATION_OPTIONS = {
18
COLLAPSE_INDEX: false,
23
<script type="text/javascript" src="../_static/jquery.js"></script>
24
<script type="text/javascript" src="../_static/underscore.js"></script>
25
<script type="text/javascript" src="../_static/doctools.js"></script>
26
<script type="text/javascript" src="../_static/sidebar.js"></script>
27
<link rel="search" type="application/opensearchdescription+xml"
28
title="Search within Python 2.7.12 documentation"
29
href="../_static/opensearch.xml"/>
30
<link rel="author" title="About these documents" href="../about.html" />
31
<link rel="copyright" title="Copyright" href="../copyright.html" />
32
<link rel="top" title="Python 2.7.12 documentation" href="../contents.html" />
33
<link rel="up" title="The Python Standard Library" href="index.html" />
34
<link rel="next" title="10.1. os.path — Common pathname manipulations" href="os.path.html" />
35
<link rel="prev" title="9.9. operator — Standard operators as functions" href="operator.html" />
36
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
<script type="text/javascript" src="../_static/copybutton.js"></script>
38
<script type="text/javascript" src="../_static/version_switch.js"></script>
43
<body role="document">
44
<div class="related" role="navigation" aria-label="related navigation">
47
<li class="right" style="margin-right: 10px">
48
<a href="../genindex.html" title="General Index"
49
accesskey="I">index</a></li>
51
<a href="../py-modindex.html" title="Python Module Index"
54
<a href="os.path.html" title="10.1. os.path — Common pathname manipulations"
55
accesskey="N">next</a> |</li>
57
<a href="operator.html" title="9.9. operator — Standard operators as functions"
58
accesskey="P">previous</a> |</li>
59
<li><img src="../_static/py.png" alt=""
60
style="vertical-align: middle; margin-top: -1px"/></li>
61
<li><a href="https://www.python.org/">Python</a> »</li>
63
<span class="version_switcher_placeholder">2.7.12</span>
64
<a href="../index.html">Documentation</a> »
67
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> »</li>
71
<div class="document">
72
<div class="documentwrapper">
73
<div class="bodywrapper">
74
<div class="body" role="main">
76
<div class="section" id="file-and-directory-access">
77
<span id="filesys"></span><h1>10. File and Directory Access<a class="headerlink" href="#file-and-directory-access" title="Permalink to this headline">¶</a></h1>
78
<p>The modules described in this chapter deal with disk files and directories. For
79
example, there are modules for reading the properties of files, manipulating
80
paths in a portable way, and creating temporary files. The full list of modules
81
in this chapter is:</p>
82
<div class="toctree-wrapper compound">
84
<li class="toctree-l1"><a class="reference internal" href="os.path.html">10.1. <code class="docutils literal"><span class="pre">os.path</span></code> — Common pathname manipulations</a></li>
85
<li class="toctree-l1"><a class="reference internal" href="fileinput.html">10.2. <code class="docutils literal"><span class="pre">fileinput</span></code> — Iterate over lines from multiple input streams</a></li>
86
<li class="toctree-l1"><a class="reference internal" href="stat.html">10.3. <code class="docutils literal"><span class="pre">stat</span></code> — Interpreting <code class="docutils literal"><span class="pre">stat()</span></code> results</a></li>
87
<li class="toctree-l1"><a class="reference internal" href="statvfs.html">10.4. <code class="docutils literal"><span class="pre">statvfs</span></code> — Constants used with <code class="docutils literal"><span class="pre">os.statvfs()</span></code></a></li>
88
<li class="toctree-l1"><a class="reference internal" href="filecmp.html">10.5. <code class="docutils literal"><span class="pre">filecmp</span></code> — File and Directory Comparisons</a><ul>
89
<li class="toctree-l2"><a class="reference internal" href="filecmp.html#the-dircmp-class">10.5.1. The <code class="docutils literal"><span class="pre">dircmp</span></code> class</a></li>
92
<li class="toctree-l1"><a class="reference internal" href="tempfile.html">10.6. <code class="docutils literal"><span class="pre">tempfile</span></code> — Generate temporary files and directories</a></li>
93
<li class="toctree-l1"><a class="reference internal" href="glob.html">10.7. <code class="docutils literal"><span class="pre">glob</span></code> — Unix style pathname pattern expansion</a></li>
94
<li class="toctree-l1"><a class="reference internal" href="fnmatch.html">10.8. <code class="docutils literal"><span class="pre">fnmatch</span></code> — Unix filename pattern matching</a></li>
95
<li class="toctree-l1"><a class="reference internal" href="linecache.html">10.9. <code class="docutils literal"><span class="pre">linecache</span></code> — Random access to text lines</a></li>
96
<li class="toctree-l1"><a class="reference internal" href="shutil.html">10.10. <code class="docutils literal"><span class="pre">shutil</span></code> — High-level file operations</a><ul>
97
<li class="toctree-l2"><a class="reference internal" href="shutil.html#directory-and-files-operations">10.10.1. Directory and files operations</a><ul>
98
<li class="toctree-l3"><a class="reference internal" href="shutil.html#copytree-example">10.10.1.1. copytree example</a></li>
101
<li class="toctree-l2"><a class="reference internal" href="shutil.html#archiving-operations">10.10.2. Archiving operations</a><ul>
102
<li class="toctree-l3"><a class="reference internal" href="shutil.html#archiving-example">10.10.2.1. Archiving example</a></li>
107
<li class="toctree-l1"><a class="reference internal" href="dircache.html">10.11. <code class="docutils literal"><span class="pre">dircache</span></code> — Cached directory listings</a></li>
108
<li class="toctree-l1"><a class="reference internal" href="macpath.html">10.12. <code class="docutils literal"><span class="pre">macpath</span></code> — Mac OS 9 path manipulation functions</a></li>
111
<div class="admonition seealso">
112
<p class="first admonition-title">See also</p>
113
<dl class="last docutils">
114
<dt>Section <a class="reference internal" href="stdtypes.html#bltin-file-objects"><span>File Objects</span></a></dt>
115
<dd>A description of Python’s built-in file objects.</dd>
116
<dt>Module <a class="reference internal" href="os.html#module-os" title="os: Miscellaneous operating system interfaces."><code class="xref py py-mod docutils literal"><span class="pre">os</span></code></a></dt>
117
<dd>Operating system interfaces, including functions to work with files at a lower
118
level than the built-in file object.</dd>
127
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
128
<div class="sphinxsidebarwrapper">
129
<h4>Previous topic</h4>
130
<p class="topless"><a href="operator.html"
131
title="previous chapter">9.9. <code class="docutils literal"><span class="pre">operator</span></code> — Standard operators as functions</a></p>
133
<p class="topless"><a href="os.path.html"
134
title="next chapter">10.1. <code class="docutils literal"><span class="pre">os.path</span></code> — Common pathname manipulations</a></p>
136
<ul class="this-page-menu">
137
<li><a href="../bugs.html">Report a Bug</a></li>
138
<li><a href="../_sources/library/filesys.txt"
139
rel="nofollow">Show Source</a></li>
142
<div id="searchbox" style="display: none" role="search">
143
<h3>Quick search</h3>
144
<form class="search" action="../search.html" method="get">
145
<input type="text" name="q" />
146
<input type="submit" value="Go" />
147
<input type="hidden" name="check_keywords" value="yes" />
148
<input type="hidden" name="area" value="default" />
150
<p class="searchtip" style="font-size: 90%">
151
Enter search terms or a module, class or function name.
154
<script type="text/javascript">$('#searchbox').show(0);</script>
157
<div class="clearer"></div>
159
<div class="related" role="navigation" aria-label="related navigation">
162
<li class="right" style="margin-right: 10px">
163
<a href="../genindex.html" title="General Index"
166
<a href="../py-modindex.html" title="Python Module Index"
169
<a href="os.path.html" title="10.1. os.path — Common pathname manipulations"
172
<a href="operator.html" title="9.9. operator — Standard operators as functions"
174
<li><img src="../_static/py.png" alt=""
175
style="vertical-align: middle; margin-top: -1px"/></li>
176
<li><a href="https://www.python.org/">Python</a> »</li>
178
<span class="version_switcher_placeholder">2.7.12</span>
179
<a href="../index.html">Documentation</a> »
182
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
186
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
188
The Python Software Foundation is a non-profit corporation.
189
<a href="https://www.python.org/psf/donations/">Please donate.</a>
191
Last updated on Oct 27, 2016.
192
<a href="../bugs.html">Found a bug</a>?
194
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'