Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / html / python / mac / module-macostools.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="mac.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="mac.html" title='Macintosh Library Modules' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-findertools.html" />
<link rel="prev" href="module-MacOS.html" />
<link rel="parent" href="macpython-modules.html" />
<link rel="next" href="module-findertools.html" />
<meta name='aesop' content='information' />
<title>2.5 macostools -- Convenience routines for file manipulation</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.4 MacOS "
href="module-MacOS.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. MacPython Modules"
href="macpython-modules.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.6 findertools "
href="module-findertools.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Macintosh Library Modules</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-MacOS.html">2.4 MacOS </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="macpython-modules.html">2. MacPython Modules</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-findertools.html">2.6 findertools </A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION004500000000000000000">
2.5 <tt class="module">macostools</tt> --
Convenience routines for file manipulation</A>
</H1>
<P>
<A NAME="module-macostools"></A>
<p class="availability">Availability: <span
class="platform">Macintosh</span>.</p>
<P>
This module contains some convenience routines for file-manipulation
on the Macintosh. All file parameters can be specified as
pathnames, <tt class="class">FSRef</tt> or <tt class="class">FSSpec</tt> objects. This module
expects a filesystem which supports forked files, so it should not
be used on UFS partitions.
<P>
The <tt class="module">macostools</tt> module defines the following functions:
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-66' xml:id='l2h-66' class="function">copy</tt></b>(</nobr></td>
<td><var>src, dst</var><big>[</big><var>, createpath</var><big>[</big><var>, copytimes</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Copy file <var>src</var> to <var>dst</var>. If <var>createpath</var> is non-zero
the folders leading to <var>dst</var> 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.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-67' xml:id='l2h-67' class="function">copytree</tt></b>(</nobr></td>
<td><var>src, dst</var>)</td></tr></table></dt>
<dd>
Recursively copy a file tree from <var>src</var> to <var>dst</var>, creating
folders as needed. <var>src</var> and <var>dst</var> should be specified as
pathnames.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-68' xml:id='l2h-68' class="function">mkalias</tt></b>(</nobr></td>
<td><var>src, dst</var>)</td></tr></table></dt>
<dd>
Create a finder alias <var>dst</var> pointing to <var>src</var>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-69' xml:id='l2h-69' class="function">touched</tt></b>(</nobr></td>
<td><var>dst</var>)</td></tr></table></dt>
<dd>
Tell the finder that some bits of finder-information such as creator
or type for file <var>dst</var> has changed. The file can be specified by
pathname or fsspec. This call should tell the finder to redraw the
files icon.
</dl>
<P>
<dl><dt><b><tt id='l2h-70' xml:id='l2h-70'>BUFSIZ</tt></b></dt>
<dd>
The buffer size for <code>copy</code>, default 1 megabyte.
</dd></dl>
<P>
Note that the process of creating finder aliases is not specified in
the Apple documentation. Hence, aliases created with <tt class="function">mkalias()</tt>
could conceivably have incompatible behaviour in some cases.
<P>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.4 MacOS "
href="module-MacOS.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. MacPython Modules"
href="macpython-modules.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.6 findertools "
href="module-findertools.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Macintosh Library Modules</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-MacOS.html">2.4 MacOS </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="macpython-modules.html">2. MacPython Modules</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-findertools.html">2.6 findertools </A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>