source: vendor/python/2.5/Doc/mac/libmacostools.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 3.6 KB
Line 
1\section{\module{macostools} ---
2 Convenience routines for file manipulation}
3
4\declaremodule{standard}{macostools}
5 \platform{Mac}
6\modulesynopsis{Convenience routines for file manipulation.}
7
8
9This module contains some convenience routines for file-manipulation
10on the Macintosh. All file parameters can be specified as
11pathnames, \class{FSRef} or \class{FSSpec} objects. This module
12expects a filesystem which supports forked files, so it should not
13be used on UFS partitions.
14
15The \module{macostools} module defines the following functions:
16
17
18\begin{funcdesc}{copy}{src, dst\optional{, createpath\optional{, copytimes}}}
19Copy file \var{src} to \var{dst}. If \var{createpath} is non-zero
20the folders leading to \var{dst} are created if necessary.
21The method copies data and
22resource fork and some finder information (creator, type, flags) and
23optionally the creation, modification and backup times (default is to
24copy them). Custom icons, comments and icon position are not copied.
25\end{funcdesc}
26
27\begin{funcdesc}{copytree}{src, dst}
28Recursively copy a file tree from \var{src} to \var{dst}, creating
29folders as needed. \var{src} and \var{dst} should be specified as
30pathnames.
31\end{funcdesc}
32
33\begin{funcdesc}{mkalias}{src, dst}
34Create a finder alias \var{dst} pointing to \var{src}.
35\end{funcdesc}
36
37\begin{funcdesc}{touched}{dst}
38Tell the finder that some bits of finder-information such as creator
39or type for file \var{dst} has changed. The file can be specified by
40pathname or fsspec. This call should tell the finder to redraw the
41files icon.
42\end{funcdesc}
43
44\begin{datadesc}{BUFSIZ}
45The buffer size for \code{copy}, default 1 megabyte.
46\end{datadesc}
47
48Note that the process of creating finder aliases is not specified in
49the Apple documentation. Hence, aliases created with \function{mkalias()}
50could conceivably have incompatible behaviour in some cases.
51
52
53\section{\module{findertools} ---
54 The \program{finder}'s Apple Events interface}
55
56\declaremodule{standard}{findertools}
57 \platform{Mac}
58\modulesynopsis{Wrappers around the \program{finder}'s Apple Events interface.}
59
60
61This module contains routines that give Python programs access to some
62functionality provided by the finder. They are implemented as wrappers
63around the AppleEvent\index{AppleEvents} interface to the finder.
64
65All file and folder parameters can be specified either as full
66pathnames, or as \class{FSRef} or \class{FSSpec} objects.
67
68The \module{findertools} module defines the following functions:
69
70
71\begin{funcdesc}{launch}{file}
72Tell the finder to launch \var{file}. What launching means depends on the file:
73applications are started, folders are opened and documents are opened
74in the correct application.
75\end{funcdesc}
76
77\begin{funcdesc}{Print}{file}
78Tell the finder to print a file. The behaviour is identical to selecting the file and using
79the print command in the finder's file menu.
80\end{funcdesc}
81
82\begin{funcdesc}{copy}{file, destdir}
83Tell the finder to copy a file or folder \var{file} to folder
84\var{destdir}. The function returns an \class{Alias} object pointing to
85the new file.
86\end{funcdesc}
87
88\begin{funcdesc}{move}{file, destdir}
89Tell the finder to move a file or folder \var{file} to folder
90\var{destdir}. The function returns an \class{Alias} object pointing to
91the new file.
92\end{funcdesc}
93
94\begin{funcdesc}{sleep}{}
95Tell the finder to put the Macintosh to sleep, if your machine
96supports it.
97\end{funcdesc}
98
99\begin{funcdesc}{restart}{}
100Tell the finder to perform an orderly restart of the machine.
101\end{funcdesc}
102
103\begin{funcdesc}{shutdown}{}
104Tell the finder to perform an orderly shutdown of the machine.
105\end{funcdesc}
Note: See TracBrowser for help on using the repository browser.