Mercurial > cpython-lru_cache-weakref
annotate Doc/libmacostools.tex @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 4cef23e1dcca |
| children | 3468ea8645ca |
| rev | line source |
|---|---|
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
1 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
2 \section{Standard module \sectcode{macostools}} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
3 \stmodindex{macostools} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
4 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
5 This module contains some convenience routines for file-manipulation |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
6 on the Macintosh. |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
7 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
8 The \code{macostools} module defines the following functions: |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
9 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
10 \renewcommand{\indexsubitem}{(in module macostools)} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
11 |
|
4410
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
12 \begin{funcdesc}{copy}{src\, dst\optional{\, createpath, copytimes}} |
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
13 Copy file \var{src} to \var{dst}. The files can be specified as |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
14 pathnames or \code{FSSpec} objects. If \var{createpath} is non-zero |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
15 \var{dst} must be a pathname and the folders leading to the |
|
4410
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
16 destination are created if necessary. The method copies data and |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
17 resource fork and some finder information (creator, type, flags) and |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
18 optionally the creation, modification and backup times (default is to |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
19 copy them). Custom icons, comments and icon position are not copied. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
20 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
21 If the source is an alias the original to which the alias points is |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
22 copied, not the aliasfile. |
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
23 \end{funcdesc} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
24 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
25 \begin{funcdesc}{copytree}{src\, dst} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
26 Recursively copy a file tree from \var{src} to \var{dst}, creating |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
27 folders as needed. \var{Src} and \var{dst} should be specified as |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
28 pathnames. |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
29 \end{funcdesc} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
30 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
31 \begin{funcdesc}{mkalias}{src\, dst} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
32 Create a finder alias \var{dst} pointing to \var{src}. Both may be |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
33 specified as pathnames or \var{FSSpec} objects. |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
34 \end{funcdesc} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
35 |
|
4410
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
36 \begin{funcdesc}{touched}{dst} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
37 Tell the finder that some bits of finder-information such as creator |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
38 or type for file \var{dst} has changed. The file can be specified by |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
39 pathname or fsspec. This call should prod the finder into redrawing the |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
40 files icon. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
41 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
42 |
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
43 \begin{datadesc}{BUFSIZ} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
44 The buffer size for \code{copy}, default 1 megabyte. |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
45 \end{datadesc} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
46 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
47 Note that the process of creating finder aliases is not specified in |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
48 the Apple documentation. Hence, aliases created with \code{mkalias} |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
49 could conceivably have incompatible behaviour in some cases. |
|
4410
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
50 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
51 \section{Standard module \sectcode{findertools}} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
52 \stmodindex{findertools} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
53 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
54 This module contains routines that give Python programs access to some |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
55 functionality provided by the finder. They are implemented as wrappers |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
56 around the AppleEvent interface to the finder. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
57 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
58 All file and folder parameters can be specified either as full |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
59 pathnames or as \code{FSSpec} objects. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
60 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
61 The \code{findertools} module defines the following functions: |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
62 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
63 \renewcommand{\indexsubitem}{(in module macostools)} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
64 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
65 \begin{funcdesc}{launch}{file} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
66 Tell the finder to launch \var{file}. What launching means depends on the file: |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
67 applications are started, folders are opened and documents are opened |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
68 in the correct application. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
69 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
70 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
71 \begin{funcdesc}{Print}{file} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
72 Tell the finder to print a file (again specified by full pathname or |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
73 FSSpec). The behaviour is identical to selecting the file and using |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
74 the print command in the finder. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
75 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
76 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
77 \begin{funcdesc}{copy}{file, destdir} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
78 Tell the finder to copy a file or folder \var{file} to folder |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
79 \var{destdir}. The function returns an \code{Alias} object pointing to |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
80 the new file. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
81 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
82 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
83 \begin{funcdesc}{move}{file, destdir} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
84 Tell the finder to move a file or folder \var{file} to folder |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
85 \var{destdir}. The function returns an \code{Alias} object pointing to |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
86 the new file. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
87 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
88 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
89 \begin{funcdesc}{sleep}{} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
90 Tell the finder to put the mac to sleep, if your machine supports it. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
91 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
92 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
93 \begin{funcdesc}{restart}{} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
94 Tell the finder to perform an orderly restart of the machine. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
95 \end{funcdesc} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
96 |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
97 \begin{funcdesc}{shutdown}{} |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
98 Tell the finder to perform an orderly shutdown of the machine. |
|
4cef23e1dcca
Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents:
3194
diff
changeset
|
99 \end{funcdesc} |
