blob: 8b943bef8eed895143ed465e03994be88fd78435 [file] [log] [blame]
Fred Drakea2890b01998-04-17 20:07:21 +00001\section{Introduction}
2\label{intro}
3
Fred Drakeb51429a1998-04-17 02:46:34 +00004The modules in this manual are available on the Apple Macintosh only.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00005
Guido van Rossum66774a91996-07-21 02:20:58 +00006Aside from the modules described here there are also interfaces to
7various MacOS toolboxes, which are currently not extensively
8described. The toolboxes for which modules exist are:
Fred Drake55fca541998-02-18 15:21:26 +00009\module{AE} (Apple Events),
10\module{Cm} (Component Manager),
11\module{Ctl} (Control Manager),
12\module{Dlg} (Dialog Manager),
13\module{Evt} (Event Manager),
14\module{Fm} (Font Manager),
15\module{List} (List Manager),
16\module{Menu} (Moenu Manager),
17\module{Qd} (QuickDraw),
18\module{Qt} (QuickTime),
19\module{Res} (Resource Manager and Handles),
20\module{Scrap} (Scrap Manager),
21\module{Snd} (Sound Manager),
22\module{TE} (TextEdit),
23\module{Waste} (non-Apple \program{TextEdit} replacement) and
24\module{Win} (Window Manager).
Guido van Rossum66774a91996-07-21 02:20:58 +000025
26If applicable the module will define a number of Python objects for
27the various structures declared by the toolbox, and operations will be
28implemented as methods of the object. Other operations will be
29implemented as functions in the module. Not all operations possible in
Fred Drakeaf9b6e61998-02-19 19:45:19 +000030\C{} will also be possible in Python (callbacks are often a problem), and
Guido van Rossum66774a91996-07-21 02:20:58 +000031parameters will occasionally be different in Python (input and output
32buffers, especially). All methods and functions have a \code{__doc__}
33string describing their arguments and return values, and for
Fred Drakeaf9b6e61998-02-19 19:45:19 +000034additional description you are referred to \emph{Inside Macintosh} or
35similar works.
36
37The following modules are documented here:
38
Fred Drakefe7f3bc1998-07-23 17:55:31 +000039\localmoduletable
Fred Drakeaf9b6e61998-02-19 19:45:19 +000040
Guido van Rossum66774a91996-07-21 02:20:58 +000041
Fred Drake3a0351c1998-04-04 07:23:21 +000042\section{Built-in Module \module{mac}}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000043\declaremodule{builtin}{mac}
44
45\modulesynopsis{Similar interfaces to the \module{posix} module.}
46
Fred Drake55fca541998-02-18 15:21:26 +000047
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000048This module provides a subset of the operating system dependent
Fred Drake55fca541998-02-18 15:21:26 +000049functionality provided by the optional built-in module \module{posix}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000050It is best accessed through the more portable standard module
Fred Drake55fca541998-02-18 15:21:26 +000051\module{os}.
Fred Drake8a528bd1997-12-15 21:40:15 +000052\refbimodindex{posix}
53\refstmodindex{os}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000054
55The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000056\function{chdir()},
57\function{close()},
58\function{dup()},
59\function{fdopen()},
60\function{getcwd()},
61\function{lseek()},
62\function{listdir()},
63\function{mkdir()},
64\function{open()},
65\function{read()},
66\function{rename()},
67\function{rmdir()},
68\function{stat()},
69\function{sync()},
70\function{unlink()},
71\function{write()},
72as well as the exception \exception{error}. Note that the times
73returned by \function{stat()} are floating-point values, like all time
74values in MacPython.
Guido van Rossum7e42cab1996-10-15 14:37:31 +000075
Fred Drake55fca541998-02-18 15:21:26 +000076One additional function is available: \function{xstat()}. This function
77returns the same information as \function{stat()}, but with three extra
Guido van Rossum7e42cab1996-10-15 14:37:31 +000078values appended: the size of the resource fork of the file and its
Fred Drakeb51429a1998-04-17 02:46:34 +0000794-character creator and type.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000080
Fred Drakefe7f3bc1998-07-23 17:55:31 +000081
Fred Drake3a0351c1998-04-04 07:23:21 +000082\section{Standard Module \module{macpath}}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000083\declaremodule{standard}{macpath}
84
85\modulesynopsis{MacOS path manipulation functions.}
86
Fred Drake55fca541998-02-18 15:21:26 +000087
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000088This module provides a subset of the pathname manipulation functions
Fred Drake55fca541998-02-18 15:21:26 +000089available from the optional standard module \module{posixpath}. It is
90best accessed through the more portable standard module \module{os}, as
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000091\code{os.path}.
Fred Drake8a528bd1997-12-15 21:40:15 +000092\refstmodindex{posixpath}
93\refstmodindex{os}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000094
95The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000096\function{normcase()},
97\function{normpath()},
98\function{isabs()},
99\function{join()},
100\function{split()},
101\function{isdir()},
102\function{isfile()},
103\function{walk()},
104\function{exists()}.
105For other functions available in \module{posixpath} dummy counterparts
Guido van Rossum66774a91996-07-21 02:20:58 +0000106are available.