1 \section{\module{macostools
} ---
2 Convenience routines for file manipulation
}
4 \declaremodule{standard
}{macostools
}
6 \modulesynopsis{Convenience routines for file manipulation.
}
9 This module contains some convenience routines for file-manipulation
10 on the Macintosh. All file parameters can be specified as
11 pathnames,
\class{FSRef
} or
\class{FSSpec
} objects.
13 The
\module{macostools
} module defines the following functions:
16 \begin{funcdesc
}{copy
}{src, dst
\optional{, createpath
\optional{, copytimes
}}}
17 Copy file
\var{src
} to
\var{dst
}. If
\var{createpath
} is non-zero
18 the folders leading to
\var{dst
} are created if necessary.
19 The method copies data and
20 resource fork and some finder information (creator, type, flags) and
21 optionally the creation, modification and backup times (default is to
22 copy them). Custom icons, comments and icon position are not copied.
25 \begin{funcdesc
}{copytree
}{src, dst
}
26 Recursively copy a file tree from
\var{src
} to
\var{dst
}, creating
27 folders as needed.
\var{src
} and
\var{dst
} should be specified as
31 \begin{funcdesc
}{mkalias
}{src, dst
}
32 Create a finder alias
\var{dst
} pointing to
\var{src
}.
35 \begin{funcdesc
}{touched
}{dst
}
36 Tell the finder that some bits of finder-information such as creator
37 or type for file
\var{dst
} has changed. The file can be specified by
38 pathname or fsspec. This call should tell the finder to redraw the
42 \begin{datadesc
}{BUFSIZ
}
43 The buffer size for
\code{copy
}, default
1 megabyte.
46 Note that the process of creating finder aliases is not specified in
47 the Apple documentation. Hence, aliases created with
\function{mkalias()
}
48 could conceivably have incompatible behaviour in some cases.
51 \section{\module{findertools
} ---
52 The
\program{finder
}'s Apple Events interface
}
54 \declaremodule{standard
}{findertools
}
56 \modulesynopsis{Wrappers around the
\program{finder
}'s Apple Events interface.
}
59 This module contains routines that give Python programs access to some
60 functionality provided by the finder. They are implemented as wrappers
61 around the AppleEvent
\index{AppleEvents
} interface to the finder.
63 All file and folder parameters can be specified either as full
64 pathnames, or as
\class{FSRef
} or
\class{FSSpec
} objects.
66 The
\module{findertools
} module defines the following functions:
69 \begin{funcdesc
}{launch
}{file
}
70 Tell the finder to launch
\var{file
}. What launching means depends on the file:
71 applications are started, folders are opened and documents are opened
72 in the correct application.
75 \begin{funcdesc
}{Print
}{file
}
76 Tell the finder to print a file. The behaviour is identical to selecting the file and using
77 the print command in the finder's file menu.
80 \begin{funcdesc
}{copy
}{file, destdir
}
81 Tell the finder to copy a file or folder
\var{file
} to folder
82 \var{destdir
}. The function returns an
\class{Alias
} object pointing to
86 \begin{funcdesc
}{move
}{file, destdir
}
87 Tell the finder to move a file or folder
\var{file
} to folder
88 \var{destdir
}. The function returns an
\class{Alias
} object pointing to
92 \begin{funcdesc
}{sleep
}{}
93 Tell the finder to put the Macintosh to sleep, if your machine
97 \begin{funcdesc
}{restart
}{}
98 Tell the finder to perform an orderly restart of the machine.
101 \begin{funcdesc
}{shutdown
}{}
102 Tell the finder to perform an orderly shutdown of the machine.