<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>10. macostools --
Convenience routines for file manipulation</TITLE>
<META NAME="description" CONTENT="10. macostools --
Convenience routines for file manipulation">
<META NAME="keywords" CONTENT="mac">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="mac.css">
<LINK REL="next" HREF="module-findertools.html">
<LINK REL="previous" HREF="module-MacOS.html">
<LINK REL="up" HREF="contents.html">
<LINK REL="next" HREF="module-findertools.html">
</HEAD>
<BODY bgcolor="#ffffff">
<div class=navigation>
<table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-findertools.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="module-MacOS.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-findertools.html">11. findertools  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="module-MacOS.html">9. MacOS  </A></span>
<br><hr></div>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0021000000000000000000">
10. <tt class=module>macostools</tt> --
         Convenience routines for file manipulation</A>
</H1>

<P>
  
<p class=availability>Availability: <span
 class=platform>Macintosh</span>.</p>

<P>
This module contains some convenience routines for file-manipulation
on the Macintosh.

<P>
The <tt class=module>macostools</tt> module defines the following functions:

<P>
<dl><dt><b><a name="l2h-147"><tt class=function>copy</tt></a></b> (<var>src, dst</var><big>[</big><var>, createpath</var><big>[</big><var>, copytimes</var><big>]</big><big>]</big>)
<dd>
Copy file <var>src</var> to <var>dst</var>. The files can be specified as
pathnames or FSSpec objects. If <var>createpath</var> is non-zero
<var>dst</var> must be a pathname and the folders leading to the
destination 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>
If the source is an alias the original to which the alias points is
copied, not the aliasfile.
</dl>

<P>
<dl><dt><b><a name="l2h-148"><tt class=function>copytree</tt></a></b> (<var>src, dst</var>)
<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><b><a name="l2h-149"><tt class=function>mkalias</tt></a></b> (<var>src, dst</var>)
<dd>
Create a finder alias <var>dst</var> pointing to <var>src</var>. Both may be
specified as pathnames or FSSpec objects.
</dl>

<P>
<dl><dt><b><a name="l2h-150"><tt class=function>touched</tt></a></b> (<var>dst</var>)
<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 prod the finder into redrawing the
files icon.
</dl>

<P>
<dl><dt><b><a name="l2h-151"><tt>BUFSIZ</tt></a></b>
<dd>
The buffer size for <tt>copy</tt>, default 1 megabyte.
</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>
<p>
<div class=navigation><hr><table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-findertools.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="module-MacOS.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-findertools.html">11. findertools  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="module-MacOS.html">9. MacOS  </A></span>
</div>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>Send comments on this document to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.
</ADDRESS>
</BODY>
</HTML>
