Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="os-process.html" /> | |
13 | <link rel="prev" href="os-fd-ops.html" /> | |
14 | <link rel="parent" href="module-os.html" /> | |
15 | <link rel="next" href="os-process.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>6.1.4 Files and Directories </title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="6.1.3 File Descriptor Operations" | |
25 | href="os-fd-ops.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="6.1 os " | |
28 | href="module-os.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="6.1.5 Process Management" | |
31 | href="os-process.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="os-fd-ops.html">6.1.3 File Descriptor Operations</A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-os.html">6.1 os </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="os-process.html">6.1.5 Process Management</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION008140000000000000000"></A><A NAME="os-file-dir"></A> | |
56 | <BR> | |
57 | 6.1.4 Files and Directories | |
58 | </H2> | |
59 | ||
60 | <P> | |
61 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
62 | <td><nobr><b><tt id='l2h-1598' xml:id='l2h-1598' class="function">access</tt></b>(</nobr></td> | |
63 | <td><var>path, mode</var>)</td></tr></table></dt> | |
64 | <dd> | |
65 | Use the real uid/gid to test for access to <var>path</var>. Note that most | |
66 | operations will use the effective uid/gid, therefore this routine can | |
67 | be used in a suid/sgid environment to test if the invoking user has the | |
68 | specified access to <var>path</var>. <var>mode</var> should be <tt class="constant">F_OK</tt> | |
69 | to test the existence of <var>path</var>, or it can be the inclusive OR of | |
70 | one or more of <tt class="constant">R_OK</tt>, <tt class="constant">W_OK</tt>, and <tt class="constant">X_OK</tt> to | |
71 | test permissions. Return <tt class="constant">True</tt> if access is allowed, | |
72 | <tt class="constant">False</tt> if not. | |
73 | See the <span class="Unix">Unix</span> man page <span class="manpage"><i>access</i>(2)</span> for more information. | |
74 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
75 | ||
76 | <P> | |
77 | <span class="note"><b class="label">Note:</b> | |
78 | Using <tt class="function">access()</tt> to check if a user is authorized to e.g. | |
79 | open a file before actually doing so using <tt class="function">open()</tt> creates a | |
80 | security hole, because the user might exploit the short time interval | |
81 | between checking and opening the file to manipulate it.</span> | |
82 | </dl> | |
83 | ||
84 | <P> | |
85 | <dl><dt><b><tt id='l2h-1599' xml:id='l2h-1599'>F_OK</tt></b></dt> | |
86 | <dd> | |
87 | Value to pass as the <var>mode</var> parameter of <tt class="function">access()</tt> to | |
88 | test the existence of <var>path</var>. | |
89 | </dd></dl> | |
90 | ||
91 | <P> | |
92 | <dl><dt><b><tt id='l2h-1600' xml:id='l2h-1600'>R_OK</tt></b></dt> | |
93 | <dd> | |
94 | Value to include in the <var>mode</var> parameter of <tt class="function">access()</tt> | |
95 | to test the readability of <var>path</var>. | |
96 | </dd></dl> | |
97 | ||
98 | <P> | |
99 | <dl><dt><b><tt id='l2h-1601' xml:id='l2h-1601'>W_OK</tt></b></dt> | |
100 | <dd> | |
101 | Value to include in the <var>mode</var> parameter of <tt class="function">access()</tt> | |
102 | to test the writability of <var>path</var>. | |
103 | </dd></dl> | |
104 | ||
105 | <P> | |
106 | <dl><dt><b><tt id='l2h-1602' xml:id='l2h-1602'>X_OK</tt></b></dt> | |
107 | <dd> | |
108 | Value to include in the <var>mode</var> parameter of <tt class="function">access()</tt> | |
109 | to determine if <var>path</var> can be executed. | |
110 | </dd></dl> | |
111 | ||
112 | <P> | |
113 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
114 | <td><nobr><b><tt id='l2h-1603' xml:id='l2h-1603' class="function">chdir</tt></b>(</nobr></td> | |
115 | <td><var>path</var>)</td></tr></table></dt> | |
116 | <dd> | |
117 | <a id='l2h-1639' xml:id='l2h-1639'></a> | |
118 | Change the current working directory to <var>path</var>. | |
119 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
120 | </dl> | |
121 | ||
122 | <P> | |
123 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
124 | <td><nobr><b><tt id='l2h-1604' xml:id='l2h-1604' class="function">fchdir</tt></b>(</nobr></td> | |
125 | <td><var>fd</var>)</td></tr></table></dt> | |
126 | <dd> | |
127 | Change the current working directory to the directory represented by | |
128 | the file descriptor <var>fd</var>. The descriptor must refer to an opened | |
129 | directory, not an open file. | |
130 | Availability: <span class="Unix">Unix</span>. | |
131 | ||
132 | <span class="versionnote">New in version 2.3.</span> | |
133 | ||
134 | </dl> | |
135 | ||
136 | <P> | |
137 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
138 | <td><nobr><b><tt id='l2h-1605' xml:id='l2h-1605' class="function">getcwd</tt></b>(</nobr></td> | |
139 | <td><var></var>)</td></tr></table></dt> | |
140 | <dd> | |
141 | Return a string representing the current working directory. | |
142 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
143 | </dl> | |
144 | ||
145 | <P> | |
146 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
147 | <td><nobr><b><tt id='l2h-1606' xml:id='l2h-1606' class="function">getcwdu</tt></b>(</nobr></td> | |
148 | <td><var></var>)</td></tr></table></dt> | |
149 | <dd> | |
150 | Return a Unicode object representing the current working directory. | |
151 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
152 | ||
153 | <span class="versionnote">New in version 2.3.</span> | |
154 | ||
155 | </dl> | |
156 | ||
157 | <P> | |
158 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
159 | <td><nobr><b><tt id='l2h-1607' xml:id='l2h-1607' class="function">chroot</tt></b>(</nobr></td> | |
160 | <td><var>path</var>)</td></tr></table></dt> | |
161 | <dd> | |
162 | Change the root directory of the current process to <var>path</var>. | |
163 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
164 | ||
165 | <span class="versionnote">New in version 2.2.</span> | |
166 | ||
167 | </dl> | |
168 | ||
169 | <P> | |
170 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
171 | <td><nobr><b><tt id='l2h-1608' xml:id='l2h-1608' class="function">chmod</tt></b>(</nobr></td> | |
172 | <td><var>path, mode</var>)</td></tr></table></dt> | |
173 | <dd> | |
174 | Change the mode of <var>path</var> to the numeric <var>mode</var>. | |
175 | <var>mode</var> may take one of the following values | |
176 | (as defined in the <tt class="module">stat</tt> module): | |
177 | ||
178 | <UL> | |
179 | <LI><code>S_ISUID</code> | |
180 | </LI> | |
181 | <LI><code>S_ISGID</code> | |
182 | </LI> | |
183 | <LI><code>S_ENFMT</code> | |
184 | </LI> | |
185 | <LI><code>S_ISVTX</code> | |
186 | </LI> | |
187 | <LI><code>S_IREAD</code> | |
188 | </LI> | |
189 | <LI><code>S_IWRITE</code> | |
190 | </LI> | |
191 | <LI><code>S_IEXEC</code> | |
192 | </LI> | |
193 | <LI><code>S_IRWXU</code> | |
194 | </LI> | |
195 | <LI><code>S_IRUSR</code> | |
196 | </LI> | |
197 | <LI><code>S_IWUSR</code> | |
198 | </LI> | |
199 | <LI><code>S_IXUSR</code> | |
200 | </LI> | |
201 | <LI><code>S_IRWXG</code> | |
202 | </LI> | |
203 | <LI><code>S_IRGRP</code> | |
204 | </LI> | |
205 | <LI><code>S_IWGRP</code> | |
206 | </LI> | |
207 | <LI><code>S_IXGRP</code> | |
208 | </LI> | |
209 | <LI><code>S_IRWXO</code> | |
210 | </LI> | |
211 | <LI><code>S_IROTH</code> | |
212 | </LI> | |
213 | <LI><code>S_IWOTH</code> | |
214 | </LI> | |
215 | <LI><code>S_IXOTH</code> | |
216 | </LI> | |
217 | </UL> | |
218 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
219 | ||
220 | <P> | |
221 | <span class="note"><b class="label">Note:</b> | |
222 | Although Windows supports <tt class="function">chmod()</tt>, you can only | |
223 | set the file's read-only flag with it (via the <code>S_IWRITE</code> | |
224 | and <code>S_IREAD</code> constants or a corresponding integer value). | |
225 | All other bits are ignored.</span> | |
226 | </dl> | |
227 | ||
228 | <P> | |
229 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
230 | <td><nobr><b><tt id='l2h-1609' xml:id='l2h-1609' class="function">chown</tt></b>(</nobr></td> | |
231 | <td><var>path, uid, gid</var>)</td></tr></table></dt> | |
232 | <dd> | |
233 | Change the owner and group id of <var>path</var> to the numeric <var>uid</var> | |
234 | and <var>gid</var>. To leave one of the ids unchanged, set it to -1. | |
235 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
236 | </dl> | |
237 | ||
238 | <P> | |
239 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
240 | <td><nobr><b><tt id='l2h-1610' xml:id='l2h-1610' class="function">lchown</tt></b>(</nobr></td> | |
241 | <td><var>path, uid, gid</var>)</td></tr></table></dt> | |
242 | <dd> | |
243 | Change the owner and group id of <var>path</var> to the numeric <var>uid</var> | |
244 | and gid. This function will not follow symbolic links. | |
245 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
246 | ||
247 | <span class="versionnote">New in version 2.3.</span> | |
248 | ||
249 | </dl> | |
250 | ||
251 | <P> | |
252 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
253 | <td><nobr><b><tt id='l2h-1611' xml:id='l2h-1611' class="function">link</tt></b>(</nobr></td> | |
254 | <td><var>src, dst</var>)</td></tr></table></dt> | |
255 | <dd> | |
256 | Create a hard link pointing to <var>src</var> named <var>dst</var>. | |
257 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
258 | </dl> | |
259 | ||
260 | <P> | |
261 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
262 | <td><nobr><b><tt id='l2h-1612' xml:id='l2h-1612' class="function">listdir</tt></b>(</nobr></td> | |
263 | <td><var>path</var>)</td></tr></table></dt> | |
264 | <dd> | |
265 | Return a list containing the names of the entries in the directory. | |
266 | The list is in arbitrary order. It does not include the special | |
267 | entries <code>'.'</code> and <code>'..'</code> even if they are present in the | |
268 | directory. | |
269 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
270 | ||
271 | <P> | |
272 | ||
273 | <span class="versionnote">Changed in version 2.3: | |
274 | On Windows NT/2k/XP and Unix, if <var>path</var> is a Unicode | |
275 | object, the result will be a list of Unicode objects..</span> | |
276 | ||
277 | </dl> | |
278 | ||
279 | <P> | |
280 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
281 | <td><nobr><b><tt id='l2h-1613' xml:id='l2h-1613' class="function">lstat</tt></b>(</nobr></td> | |
282 | <td><var>path</var>)</td></tr></table></dt> | |
283 | <dd> | |
284 | Like <tt class="function">stat()</tt>, but do not follow symbolic links. | |
285 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
286 | </dl> | |
287 | ||
288 | <P> | |
289 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
290 | <td><nobr><b><tt id='l2h-1614' xml:id='l2h-1614' class="function">mkfifo</tt></b>(</nobr></td> | |
291 | <td><var>path</var><big>[</big><var>, mode</var><big>]</big><var></var>)</td></tr></table></dt> | |
292 | <dd> | |
293 | Create a FIFO (a named pipe) named <var>path</var> with numeric mode | |
294 | <var>mode</var>. The default <var>mode</var> is <code>0666</code> (octal). The current | |
295 | umask value is first masked out from the mode. | |
296 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
297 | ||
298 | <P> | |
299 | FIFOs are pipes that can be accessed like regular files. FIFOs exist | |
300 | until they are deleted (for example with <tt class="function">os.unlink()</tt>). | |
301 | Generally, FIFOs are used as rendezvous between ``client'' and | |
302 | ``server'' type processes: the server opens the FIFO for reading, and | |
303 | the client opens it for writing. Note that <tt class="function">mkfifo()</tt> | |
304 | doesn't open the FIFO -- it just creates the rendezvous point. | |
305 | </dl> | |
306 | ||
307 | <P> | |
308 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
309 | <td><nobr><b><tt id='l2h-1615' xml:id='l2h-1615' class="function">mknod</tt></b>(</nobr></td> | |
310 | <td><var>path</var><big>[</big><var>, mode=0600, device</var><big>]</big><var></var>)</td></tr></table></dt> | |
311 | <dd> | |
312 | Create a filesystem node (file, device special file or named pipe) | |
313 | named filename. <var>mode</var> specifies both the permissions to use and | |
314 | the type of node to be created, being combined (bitwise OR) with one | |
315 | of S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO (those constants are | |
316 | available in <tt class="module">stat</tt>). For S_IFCHR and S_IFBLK, <var>device</var> | |
317 | defines the newly created device special file (probably using | |
318 | <tt class="function">os.makedev()</tt>), otherwise it is ignored. | |
319 | ||
320 | <span class="versionnote">New in version 2.3.</span> | |
321 | ||
322 | </dl> | |
323 | ||
324 | <P> | |
325 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
326 | <td><nobr><b><tt id='l2h-1616' xml:id='l2h-1616' class="function">major</tt></b>(</nobr></td> | |
327 | <td><var>device</var>)</td></tr></table></dt> | |
328 | <dd> | |
329 | Extracts a device major number from a raw device number. | |
330 | ||
331 | <span class="versionnote">New in version 2.3.</span> | |
332 | ||
333 | </dl> | |
334 | ||
335 | <P> | |
336 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
337 | <td><nobr><b><tt id='l2h-1617' xml:id='l2h-1617' class="function">minor</tt></b>(</nobr></td> | |
338 | <td><var>device</var>)</td></tr></table></dt> | |
339 | <dd> | |
340 | Extracts a device minor number from a raw device number. | |
341 | ||
342 | <span class="versionnote">New in version 2.3.</span> | |
343 | ||
344 | </dl> | |
345 | ||
346 | <P> | |
347 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
348 | <td><nobr><b><tt id='l2h-1618' xml:id='l2h-1618' class="function">makedev</tt></b>(</nobr></td> | |
349 | <td><var>major, minor</var>)</td></tr></table></dt> | |
350 | <dd> | |
351 | Composes a raw device number from the major and minor device numbers. | |
352 | ||
353 | <span class="versionnote">New in version 2.3.</span> | |
354 | ||
355 | </dl> | |
356 | ||
357 | <P> | |
358 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
359 | <td><nobr><b><tt id='l2h-1619' xml:id='l2h-1619' class="function">mkdir</tt></b>(</nobr></td> | |
360 | <td><var>path</var><big>[</big><var>, mode</var><big>]</big><var></var>)</td></tr></table></dt> | |
361 | <dd> | |
362 | Create a directory named <var>path</var> with numeric mode <var>mode</var>. | |
363 | The default <var>mode</var> is <code>0777</code> (octal). On some systems, | |
364 | <var>mode</var> is ignored. Where it is used, the current umask value is | |
365 | first masked out. | |
366 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
367 | </dl> | |
368 | ||
369 | <P> | |
370 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
371 | <td><nobr><b><tt id='l2h-1620' xml:id='l2h-1620' class="function">makedirs</tt></b>(</nobr></td> | |
372 | <td><var>path</var><big>[</big><var>, mode</var><big>]</big><var></var>)</td></tr></table></dt> | |
373 | <dd> | |
374 | Recursive directory creation function.<a id='l2h-1640' xml:id='l2h-1640'></a> | |
375 | Like <tt class="function">mkdir()</tt>, | |
376 | but makes all intermediate-level directories needed to contain the | |
377 | leaf directory. Throws an <tt class="exception">error</tt> exception if the leaf | |
378 | directory already exists or cannot be created. The default <var>mode</var> | |
379 | is <code>0777</code> (octal). This function does not properly handle UNC | |
380 | paths (only relevant on Windows systems; Universal Naming Convention | |
381 | paths are those that use the `<code>\\host\path</code>' syntax). | |
382 | ||
383 | <span class="versionnote">New in version 1.5.2.</span> | |
384 | ||
385 | </dl> | |
386 | ||
387 | <P> | |
388 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
389 | <td><nobr><b><tt id='l2h-1621' xml:id='l2h-1621' class="function">pathconf</tt></b>(</nobr></td> | |
390 | <td><var>path, name</var>)</td></tr></table></dt> | |
391 | <dd> | |
392 | Return system configuration information relevant to a named file. | |
393 | <var>name</var> specifies the configuration value to retrieve; it may be a | |
394 | string which is the name of a defined system value; these names are | |
395 | specified in a number of standards (POSIX.1, <span class="Unix">Unix</span> 95, <span class="Unix">Unix</span> 98, and | |
396 | others). Some platforms define additional names as well. The names | |
397 | known to the host operating system are given in the | |
398 | <code>pathconf_names</code> dictionary. For configuration variables not | |
399 | included in that mapping, passing an integer for <var>name</var> is also | |
400 | accepted. | |
401 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
402 | ||
403 | <P> | |
404 | If <var>name</var> is a string and is not known, <tt class="exception">ValueError</tt> is | |
405 | raised. If a specific value for <var>name</var> is not supported by the | |
406 | host system, even if it is included in <code>pathconf_names</code>, an | |
407 | <tt class="exception">OSError</tt> is raised with <tt class="constant">errno.EINVAL</tt> for the | |
408 | error number. | |
409 | </dl> | |
410 | ||
411 | <P> | |
412 | <dl><dt><b><tt id='l2h-1622' xml:id='l2h-1622'>pathconf_names</tt></b></dt> | |
413 | <dd> | |
414 | Dictionary mapping names accepted by <tt class="function">pathconf()</tt> and | |
415 | <tt class="function">fpathconf()</tt> to the integer values defined for those names | |
416 | by the host operating system. This can be used to determine the set | |
417 | of names known to the system. | |
418 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
419 | </dd></dl> | |
420 | ||
421 | <P> | |
422 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
423 | <td><nobr><b><tt id='l2h-1623' xml:id='l2h-1623' class="function">readlink</tt></b>(</nobr></td> | |
424 | <td><var>path</var>)</td></tr></table></dt> | |
425 | <dd> | |
426 | Return a string representing the path to which the symbolic link | |
427 | points. The result may be either an absolute or relative pathname; if | |
428 | it is relative, it may be converted to an absolute pathname using | |
429 | <code>os.path.join(os.path.dirname(<var>path</var>), <var>result</var>)</code>. | |
430 | Availability: Macintosh, <span class="Unix">Unix</span>. | |
431 | </dl> | |
432 | ||
433 | <P> | |
434 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
435 | <td><nobr><b><tt id='l2h-1624' xml:id='l2h-1624' class="function">remove</tt></b>(</nobr></td> | |
436 | <td><var>path</var>)</td></tr></table></dt> | |
437 | <dd> | |
438 | Remove the file <var>path</var>. If <var>path</var> is a directory, | |
439 | <tt class="exception">OSError</tt> is raised; see <tt class="function">rmdir()</tt> below to remove | |
440 | a directory. This is identical to the <tt class="function">unlink()</tt> function | |
441 | documented below. On Windows, attempting to remove a file that is in | |
442 | use causes an exception to be raised; on <span class="Unix">Unix</span>, the directory entry is | |
443 | removed but the storage allocated to the file is not made available | |
444 | until the original file is no longer in use. | |
445 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
446 | </dl> | |
447 | ||
448 | <P> | |
449 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
450 | <td><nobr><b><tt id='l2h-1625' xml:id='l2h-1625' class="function">removedirs</tt></b>(</nobr></td> | |
451 | <td><var>path</var>)</td></tr></table></dt> | |
452 | <dd> | |
453 | <a id='l2h-1641' xml:id='l2h-1641'></a> | |
454 | Removes directories recursively. Works like | |
455 | <tt class="function">rmdir()</tt> except that, if the leaf directory is | |
456 | successfully removed, directories corresponding to rightmost path | |
457 | segments will be pruned way until either the whole path is consumed or | |
458 | an error is raised (which is ignored, because it generally means that | |
459 | a parent directory is not empty). Throws an <tt class="exception">error</tt> | |
460 | exception if the leaf directory could not be successfully removed. | |
461 | ||
462 | <span class="versionnote">New in version 1.5.2.</span> | |
463 | ||
464 | </dl> | |
465 | ||
466 | <P> | |
467 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
468 | <td><nobr><b><tt id='l2h-1626' xml:id='l2h-1626' class="function">rename</tt></b>(</nobr></td> | |
469 | <td><var>src, dst</var>)</td></tr></table></dt> | |
470 | <dd> | |
471 | Rename the file or directory <var>src</var> to <var>dst</var>. If <var>dst</var> is | |
472 | a directory, <tt class="exception">OSError</tt> will be raised. On <span class="Unix">Unix</span>, if | |
473 | <var>dst</var> exists and is a file, it will be removed silently if the | |
474 | user has permission. The operation may fail on some <span class="Unix">Unix</span> flavors | |
475 | if <var>src</var> and <var>dst</var> are on different filesystems. If | |
476 | successful, the renaming will be an atomic operation (this is a | |
477 | POSIX requirement). On Windows, if <var>dst</var> already exists, | |
478 | <tt class="exception">OSError</tt> will be raised even if it is a file; there may be | |
479 | no way to implement an atomic rename when <var>dst</var> names an existing | |
480 | file. | |
481 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
482 | </dl> | |
483 | ||
484 | <P> | |
485 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
486 | <td><nobr><b><tt id='l2h-1627' xml:id='l2h-1627' class="function">renames</tt></b>(</nobr></td> | |
487 | <td><var>old, new</var>)</td></tr></table></dt> | |
488 | <dd> | |
489 | Recursive directory or file renaming function. | |
490 | Works like <tt class="function">rename()</tt>, except creation of any intermediate | |
491 | directories needed to make the new pathname good is attempted first. | |
492 | After the rename, directories corresponding to rightmost path segments | |
493 | of the old name will be pruned away using <tt class="function">removedirs()</tt>. | |
494 | ||
495 | <span class="versionnote">New in version 1.5.2.</span> | |
496 | ||
497 | <P> | |
498 | <div class="note"><b class="label">Note:</b> | |
499 | This function can fail with the new directory structure made if | |
500 | you lack permissions needed to remove the leaf directory or file. | |
501 | </div> | |
502 | </dl> | |
503 | ||
504 | <P> | |
505 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
506 | <td><nobr><b><tt id='l2h-1628' xml:id='l2h-1628' class="function">rmdir</tt></b>(</nobr></td> | |
507 | <td><var>path</var>)</td></tr></table></dt> | |
508 | <dd> | |
509 | Remove the directory <var>path</var>. | |
510 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
511 | </dl> | |
512 | ||
513 | <P> | |
514 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
515 | <td><nobr><b><tt id='l2h-1629' xml:id='l2h-1629' class="function">stat</tt></b>(</nobr></td> | |
516 | <td><var>path</var>)</td></tr></table></dt> | |
517 | <dd> | |
518 | Perform a <tt class="cfunction">stat()</tt> system call on the given path. The | |
519 | return value is an object whose attributes correspond to the members of | |
520 | the <tt class="ctype">stat</tt> structure, namely: | |
521 | <tt class="member">st_mode</tt> (protection bits), | |
522 | <tt class="member">st_ino</tt> (inode number), | |
523 | <tt class="member">st_dev</tt> (device), | |
524 | <tt class="member">st_nlink</tt> (number of hard links), | |
525 | <tt class="member">st_uid</tt> (user ID of owner), | |
526 | <tt class="member">st_gid</tt> (group ID of owner), | |
527 | <tt class="member">st_size</tt> (size of file, in bytes), | |
528 | <tt class="member">st_atime</tt> (time of most recent access), | |
529 | <tt class="member">st_mtime</tt> (time of most recent content modification), | |
530 | <tt class="member">st_ctime</tt> | |
531 | (platform dependent; time of most recent metadata change on <span class="Unix">Unix</span>, or | |
532 | the time of creation on Windows). | |
533 | ||
534 | <P> | |
535 | ||
536 | <span class="versionnote">Changed in version 2.3: | |
537 | If <tt class="function">stat_float_times</tt> returns true, the time | |
538 | values are floats, measuring seconds. Fractions of a second may be | |
539 | reported if the system supports that. On Mac OS, the times are always | |
540 | floats. See <tt class="function">stat_float_times</tt> for further discussion. .</span> | |
541 | ||
542 | <P> | |
543 | On some Unix systems (such as Linux), the following attributes may | |
544 | also be available: | |
545 | <tt class="member">st_blocks</tt> (number of blocks allocated for file), | |
546 | <tt class="member">st_blksize</tt> (filesystem blocksize), | |
547 | <tt class="member">st_rdev</tt> (type of device if an inode device). | |
548 | ||
549 | <P> | |
550 | On Mac OS systems, the following attributes may also be available: | |
551 | <tt class="member">st_rsize</tt>, | |
552 | <tt class="member">st_creator</tt>, | |
553 | <tt class="member">st_type</tt>. | |
554 | ||
555 | <P> | |
556 | On RISCOS systems, the following attributes are also available: | |
557 | <tt class="member">st_ftype</tt> (file type), | |
558 | <tt class="member">st_attrs</tt> (attributes), | |
559 | <tt class="member">st_obtype</tt> (object type). | |
560 | ||
561 | <P> | |
562 | For backward compatibility, the return value of <tt class="function">stat()</tt> is | |
563 | also accessible as a tuple of at least 10 integers giving the most | |
564 | important (and portable) members of the <tt class="ctype">stat</tt> structure, in the | |
565 | order | |
566 | <tt class="member">st_mode</tt>, | |
567 | <tt class="member">st_ino</tt>, | |
568 | <tt class="member">st_dev</tt>, | |
569 | <tt class="member">st_nlink</tt>, | |
570 | <tt class="member">st_uid</tt>, | |
571 | <tt class="member">st_gid</tt>, | |
572 | <tt class="member">st_size</tt>, | |
573 | <tt class="member">st_atime</tt>, | |
574 | <tt class="member">st_mtime</tt>, | |
575 | <tt class="member">st_ctime</tt>. | |
576 | More items may be added at the end by some implementations. | |
577 | The standard module <tt class="module"><a href="module-stat.html">stat</a></tt><a id='l2h-1642' xml:id='l2h-1642'></a> defines | |
578 | functions and constants that are useful for extracting information | |
579 | from a <tt class="ctype">stat</tt> structure. | |
580 | (On Windows, some items are filled with dummy values.) | |
581 | ||
582 | <P> | |
583 | <span class="note"><b class="label">Note:</b> | |
584 | The exact meaning and resolution of the <tt class="member">st_atime</tt>, | |
585 | <tt class="member">st_mtime</tt>, and <tt class="member">st_ctime</tt> members depends on the | |
586 | operating system and the file system. For example, on Windows systems | |
587 | using the FAT or FAT32 file systems, <tt class="member">st_mtime</tt> has 2-second | |
588 | resolution, and <tt class="member">st_atime</tt> has only 1-day resolution. See | |
589 | your operating system documentation for details.</span> | |
590 | ||
591 | <P> | |
592 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
593 | ||
594 | <P> | |
595 | ||
596 | <span class="versionnote">Changed in version 2.2: | |
597 | Added access to values as attributes of the returned object.</span> | |
598 | ||
599 | </dl> | |
600 | ||
601 | <P> | |
602 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
603 | <td><nobr><b><tt id='l2h-1630' xml:id='l2h-1630' class="function">stat_float_times</tt></b>(</nobr></td> | |
604 | <td><var></var><big>[</big><var>newvalue</var><big>]</big><var></var>)</td></tr></table></dt> | |
605 | <dd> | |
606 | Determine whether <tt class="class">stat_result</tt> represents time stamps as float | |
607 | objects. If newval is True, future calls to stat() return floats, if | |
608 | it is False, future calls return ints. If newval is omitted, return | |
609 | the current setting. | |
610 | ||
611 | <P> | |
612 | For compatibility with older Python versions, accessing | |
613 | <tt class="class">stat_result</tt> as a tuple always returns integers. For | |
614 | compatibility with Python 2.2, accessing the time stamps by field name | |
615 | also returns integers. Applications that want to determine the | |
616 | fractions of a second in a time stamp can use this function to have | |
617 | time stamps represented as floats. Whether they will actually observe | |
618 | non-zero fractions depends on the system. | |
619 | ||
620 | <P> | |
621 | Future Python releases will change the default of this setting; | |
622 | applications that cannot deal with floating point time stamps can then | |
623 | use this function to turn the feature off. | |
624 | ||
625 | <P> | |
626 | It is recommended that this setting is only changed at program startup | |
627 | time in the <var>__main__</var> module; libraries should never change this | |
628 | setting. If an application uses a library that works incorrectly if | |
629 | floating point time stamps are processed, this application should turn | |
630 | the feature off until the library has been corrected. | |
631 | ||
632 | <P> | |
633 | </dl> | |
634 | ||
635 | <P> | |
636 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
637 | <td><nobr><b><tt id='l2h-1631' xml:id='l2h-1631' class="function">statvfs</tt></b>(</nobr></td> | |
638 | <td><var>path</var>)</td></tr></table></dt> | |
639 | <dd> | |
640 | Perform a <tt class="cfunction">statvfs()</tt> system call on the given path. The | |
641 | return value is an object whose attributes describe the filesystem on | |
642 | the given path, and correspond to the members of the | |
643 | <tt class="ctype">statvfs</tt> structure, namely: | |
644 | <tt class="member">f_frsize</tt>, | |
645 | <tt class="member">f_blocks</tt>, | |
646 | <tt class="member">f_bfree</tt>, | |
647 | <tt class="member">f_bavail</tt>, | |
648 | <tt class="member">f_files</tt>, | |
649 | <tt class="member">f_ffree</tt>, | |
650 | <tt class="member">f_favail</tt>, | |
651 | <tt class="member">f_flag</tt>, | |
652 | <tt class="member">f_namemax</tt>. | |
653 | Availability: <span class="Unix">Unix</span>. | |
654 | ||
655 | <P> | |
656 | For backward compatibility, the return value is also accessible as a | |
657 | tuple whose values correspond to the attributes, in the order given above. | |
658 | The standard module <tt class="module"><a href="module-statvfs.html">statvfs</a></tt><a id='l2h-1643' xml:id='l2h-1643'></a> | |
659 | defines constants that are useful for extracting information | |
660 | from a <tt class="ctype">statvfs</tt> structure when accessing it as a sequence; this | |
661 | remains useful when writing code that needs to work with versions of | |
662 | Python that don't support accessing the fields as attributes. | |
663 | ||
664 | <P> | |
665 | ||
666 | <span class="versionnote">Changed in version 2.2: | |
667 | Added access to values as attributes of the returned object.</span> | |
668 | ||
669 | </dl> | |
670 | ||
671 | <P> | |
672 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
673 | <td><nobr><b><tt id='l2h-1632' xml:id='l2h-1632' class="function">symlink</tt></b>(</nobr></td> | |
674 | <td><var>src, dst</var>)</td></tr></table></dt> | |
675 | <dd> | |
676 | Create a symbolic link pointing to <var>src</var> named <var>dst</var>. | |
677 | Availability: <span class="Unix">Unix</span>. | |
678 | </dl> | |
679 | ||
680 | <P> | |
681 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
682 | <td><nobr><b><tt id='l2h-1633' xml:id='l2h-1633' class="function">tempnam</tt></b>(</nobr></td> | |
683 | <td><var></var><big>[</big><var>dir</var><big>[</big><var>, prefix</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> | |
684 | <dd> | |
685 | Return a unique path name that is reasonable for creating a temporary | |
686 | file. This will be an absolute path that names a potential directory | |
687 | entry in the directory <var>dir</var> or a common location for temporary | |
688 | files if <var>dir</var> is omitted or <code>None</code>. If given and not | |
689 | <code>None</code>, <var>prefix</var> is used to provide a short prefix to the | |
690 | filename. Applications are responsible for properly creating and | |
691 | managing files created using paths returned by <tt class="function">tempnam()</tt>; | |
692 | no automatic cleanup is provided. | |
693 | On <span class="Unix">Unix</span>, the environment variable <a class="envvar" id='l2h-1644' xml:id='l2h-1644'>TMPDIR</a> overrides | |
694 | <var>dir</var>, while on Windows the <a class="envvar" id='l2h-1645' xml:id='l2h-1645'>TMP</a> is used. The specific | |
695 | behavior of this function depends on the C library implementation; | |
696 | some aspects are underspecified in system documentation. | |
697 | <span class="warning"><b class="label">Warning:</b> | |
698 | Use of <tt class="function">tempnam()</tt> is vulnerable to symlink attacks; | |
699 | consider using <tt class="function">tmpfile()</tt> (section <A href="os-newstreams.html#os-newstreams">6.1.2</A>) | |
700 | instead.</span> Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
701 | </dl> | |
702 | ||
703 | <P> | |
704 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
705 | <td><nobr><b><tt id='l2h-1634' xml:id='l2h-1634' class="function">tmpnam</tt></b>(</nobr></td> | |
706 | <td><var></var>)</td></tr></table></dt> | |
707 | <dd> | |
708 | Return a unique path name that is reasonable for creating a temporary | |
709 | file. This will be an absolute path that names a potential directory | |
710 | entry in a common location for temporary files. Applications are | |
711 | responsible for properly creating and managing files created using | |
712 | paths returned by <tt class="function">tmpnam()</tt>; no automatic cleanup is | |
713 | provided. | |
714 | <span class="warning"><b class="label">Warning:</b> | |
715 | Use of <tt class="function">tmpnam()</tt> is vulnerable to symlink attacks; | |
716 | consider using <tt class="function">tmpfile()</tt> (section <A href="os-newstreams.html#os-newstreams">6.1.2</A>) | |
717 | instead.</span> Availability: <span class="Unix">Unix</span>, Windows. This function probably | |
718 | shouldn't be used on Windows, though: Microsoft's implementation of | |
719 | <tt class="function">tmpnam()</tt> always creates a name in the root directory of the | |
720 | current drive, and that's generally a poor location for a temp file | |
721 | (depending on privileges, you may not even be able to open a file | |
722 | using this name). | |
723 | </dl> | |
724 | ||
725 | <P> | |
726 | <dl><dt><b><tt id='l2h-1635' xml:id='l2h-1635'>TMP_MAX</tt></b></dt> | |
727 | <dd> | |
728 | The maximum number of unique names that <tt class="function">tmpnam()</tt> will | |
729 | generate before reusing names. | |
730 | </dd></dl> | |
731 | ||
732 | <P> | |
733 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
734 | <td><nobr><b><tt id='l2h-1636' xml:id='l2h-1636' class="function">unlink</tt></b>(</nobr></td> | |
735 | <td><var>path</var>)</td></tr></table></dt> | |
736 | <dd> | |
737 | Remove the file <var>path</var>. This is the same function as | |
738 | <tt class="function">remove()</tt>; the <tt class="function">unlink()</tt> name is its traditional | |
739 | <span class="Unix">Unix</span> name. | |
740 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
741 | </dl> | |
742 | ||
743 | <P> | |
744 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
745 | <td><nobr><b><tt id='l2h-1637' xml:id='l2h-1637' class="function">utime</tt></b>(</nobr></td> | |
746 | <td><var>path, times</var>)</td></tr></table></dt> | |
747 | <dd> | |
748 | Set the access and modified times of the file specified by <var>path</var>. | |
749 | If <var>times</var> is <code>None</code>, then the file's access and modified | |
750 | times are set to the current time. Otherwise, <var>times</var> must be a | |
751 | 2-tuple of numbers, of the form <code>(<var>atime</var>, <var>mtime</var>)</code> | |
752 | which is used to set the access and modified times, respectively. | |
753 | Whether a directory can be given for <var>path</var> depends on whether the | |
754 | operating system implements directories as files (for example, Windows | |
755 | does not). Note that the exact times you set here may not be returned | |
756 | by a subsequent <tt class="function">stat()</tt> call, depending on the resolution | |
757 | with which your operating system records access and modification times; | |
758 | see <tt class="function">stat()</tt>. | |
759 | ||
760 | <span class="versionnote">Changed in version 2.0: | |
761 | Added support for <code>None</code> for <var>times</var>.</span> | |
762 | ||
763 | Availability: Macintosh, <span class="Unix">Unix</span>, Windows. | |
764 | </dl> | |
765 | ||
766 | <P> | |
767 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
768 | <td><nobr><b><tt id='l2h-1638' xml:id='l2h-1638' class="function">walk</tt></b>(</nobr></td> | |
769 | <td><var>top</var><big>[</big><var>, topdown<code>=True</code> | |
770 | </var><big>[</big><var>, onerror<code>=None</code></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> | |
771 | <dd> | |
772 | <a id='l2h-1646' xml:id='l2h-1646'></a> | |
773 | <tt class="function">walk()</tt> generates the file names in a directory tree, by | |
774 | walking the tree either top down or bottom up. | |
775 | For each directory in the tree rooted at directory <var>top</var> (including | |
776 | <var>top</var> itself), it yields a 3-tuple | |
777 | <code>(<var>dirpath</var>, <var>dirnames</var>, <var>filenames</var>)</code>. | |
778 | ||
779 | <P> | |
780 | <var>dirpath</var> is a string, the path to the directory. <var>dirnames</var> is | |
781 | a list of the names of the subdirectories in <var>dirpath</var> | |
782 | (excluding <code>'.'</code> and <code>'..'</code>). <var>filenames</var> is a list of | |
783 | the names of the non-directory files in <var>dirpath</var>. Note that the | |
784 | names in the lists contain no path components. To get a full | |
785 | path (which begins with <var>top</var>) to a file or directory in | |
786 | <var>dirpath</var>, do <code>os.path.join(<var>dirpath</var>, <var>name</var>)</code>. | |
787 | ||
788 | <P> | |
789 | If optional argument <var>topdown</var> is true or not specified, the triple | |
790 | for a directory is generated before the triples for any of its | |
791 | subdirectories (directories are generated top down). If <var>topdown</var> is | |
792 | false, the triple for a directory is generated after the triples for all | |
793 | of its subdirectories (directories are generated bottom up). | |
794 | ||
795 | <P> | |
796 | When <var>topdown</var> is true, the caller can modify the <var>dirnames</var> list | |
797 | in-place (perhaps using <tt class="keyword">del</tt> or slice assignment), and | |
798 | <tt class="function">walk()</tt> will only recurse into the subdirectories whose names | |
799 | remain in <var>dirnames</var>; this can be used to prune the search, | |
800 | impose a specific order of visiting, or even to inform <tt class="function">walk()</tt> | |
801 | about directories the caller creates or renames before it resumes | |
802 | <tt class="function">walk()</tt> again. Modifying <var>dirnames</var> when <var>topdown</var> is | |
803 | false is ineffective, because in bottom-up mode the directories in | |
804 | <var>dirnames</var> are generated before <var>dirnames</var> itself is generated. | |
805 | ||
806 | <P> | |
807 | By default errors from the <code>os.listdir()</code> call are ignored. If | |
808 | optional argument <var>onerror</var> is specified, it should be a function; | |
809 | it will be called with one argument, an os.error instance. It can | |
810 | report the error to continue with the walk, or raise the exception | |
811 | to abort the walk. Note that the filename is available as the | |
812 | <code>filename</code> attribute of the exception object. | |
813 | ||
814 | <P> | |
815 | <div class="note"><b class="label">Note:</b> | |
816 | If you pass a relative pathname, don't change the current working | |
817 | directory between resumptions of <tt class="function">walk()</tt>. <tt class="function">walk()</tt> | |
818 | never changes the current directory, and assumes that its caller | |
819 | doesn't either. | |
820 | </div> | |
821 | ||
822 | <P> | |
823 | <div class="note"><b class="label">Note:</b> | |
824 | On systems that support symbolic links, links to subdirectories appear | |
825 | in <var>dirnames</var> lists, but <tt class="function">walk()</tt> will not visit them | |
826 | (infinite loops are hard to avoid when following symbolic links). | |
827 | To visit linked directories, you can identify them with | |
828 | <code>os.path.islink(<var>path</var>)</code>, and invoke <code>walk(<var>path</var>)</code> | |
829 | on each directly. | |
830 | </div> | |
831 | ||
832 | <P> | |
833 | This example displays the number of bytes taken by non-directory files | |
834 | in each directory under the starting directory, except that it doesn't | |
835 | look under any CVS subdirectory: | |
836 | ||
837 | <P> | |
838 | <div class="verbatim"><pre> | |
839 | import os | |
840 | from os.path import join, getsize | |
841 | for root, dirs, files in os.walk('python/Lib/email'): | |
842 | print root, "consumes", | |
843 | print sum(getsize(join(root, name)) for name in files), | |
844 | print "bytes in", len(files), "non-directory files" | |
845 | if 'CVS' in dirs: | |
846 | dirs.remove('CVS') # don't visit CVS directories | |
847 | </pre></div> | |
848 | ||
849 | <P> | |
850 | In the next example, walking the tree bottom up is essential: | |
851 | <tt class="function">rmdir()</tt> doesn't allow deleting a directory before the | |
852 | directory is empty: | |
853 | ||
854 | <P> | |
855 | <div class="verbatim"><pre> | |
856 | # Delete everything reachable from the directory named in 'top', | |
857 | # assuming there are no symbolic links. | |
858 | # CAUTION: This is dangerous! For example, if top == '/', it | |
859 | # could delete all your disk files. | |
860 | import os | |
861 | for root, dirs, files in os.walk(top, topdown=False): | |
862 | for name in files: | |
863 | os.remove(os.path.join(root, name)) | |
864 | for name in dirs: | |
865 | os.rmdir(os.path.join(root, name)) | |
866 | </pre></div> | |
867 | ||
868 | <P> | |
869 | ||
870 | <span class="versionnote">New in version 2.3.</span> | |
871 | ||
872 | </dl> | |
873 | ||
874 | <P> | |
875 | ||
876 | <DIV CLASS="navigation"> | |
877 | <div class='online-navigation'> | |
878 | <p></p><hr /> | |
879 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
880 | <tr> | |
881 | <td class='online-navigation'><a rel="prev" title="6.1.3 File Descriptor Operations" | |
882 | href="os-fd-ops.html"><img src='../icons/previous.png' | |
883 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
884 | <td class='online-navigation'><a rel="parent" title="6.1 os " | |
885 | href="module-os.html"><img src='../icons/up.png' | |
886 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
887 | <td class='online-navigation'><a rel="next" title="6.1.5 Process Management" | |
888 | href="os-process.html"><img src='../icons/next.png' | |
889 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
890 | <td align="center" width="100%">Python Library Reference</td> | |
891 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
892 | href="contents.html"><img src='../icons/contents.png' | |
893 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
894 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
895 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
896 | <td class='online-navigation'><a rel="index" title="Index" | |
897 | href="genindex.html"><img src='../icons/index.png' | |
898 | border='0' height='32' alt='Index' width='32' /></A></td> | |
899 | </tr></table> | |
900 | <div class='online-navigation'> | |
901 | <b class="navlabel">Previous:</b> | |
902 | <a class="sectref" rel="prev" href="os-fd-ops.html">6.1.3 File Descriptor Operations</A> | |
903 | <b class="navlabel">Up:</b> | |
904 | <a class="sectref" rel="parent" href="module-os.html">6.1 os </A> | |
905 | <b class="navlabel">Next:</b> | |
906 | <a class="sectref" rel="next" href="os-process.html">6.1.5 Process Management</A> | |
907 | </div> | |
908 | </div> | |
909 | <hr /> | |
910 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
911 | </DIV> | |
912 | <!--End of Navigation Panel--> | |
913 | <ADDRESS> | |
914 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
915 | </ADDRESS> | |
916 | </BODY> | |
917 | </HTML> |