blob: 1301c0102ea5fe1de704eb919eeb36eebdb63fef [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 Drakec817e271998-08-10 18:40:22 +000042\section{\module{mac} ---
Fred Drake59d8b731999-02-01 20:19:38 +000043 Implementations for the \module{os} module}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000044
Fred Drakef6863c11999-03-02 16:37:17 +000045\declaremodule{builtin}{mac}
46 \platform{Mac}
Fred Drake59d8b731999-02-01 20:19:38 +000047\modulesynopsis{Implementations for the \module{os} module.}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000048
Fred Drake55fca541998-02-18 15:21:26 +000049
Fred Drake59d8b731999-02-01 20:19:38 +000050This module implements the operating system dependent functionality
51provided by the standard module \module{os}\refstmodindex{os}. It is
52best accessed through the \module{os} module.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000053
54The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000055\function{chdir()},
56\function{close()},
57\function{dup()},
58\function{fdopen()},
59\function{getcwd()},
60\function{lseek()},
61\function{listdir()},
62\function{mkdir()},
63\function{open()},
64\function{read()},
65\function{rename()},
66\function{rmdir()},
67\function{stat()},
68\function{sync()},
69\function{unlink()},
70\function{write()},
71as well as the exception \exception{error}. Note that the times
72returned by \function{stat()} are floating-point values, like all time
73values in MacPython.
Guido van Rossum7e42cab1996-10-15 14:37:31 +000074
Fred Drake59d8b731999-02-01 20:19:38 +000075One additional function is available:
76
77\begin{funcdesc}{xstat}{path}
78 This function returns the same information as \function{stat()}, but
79 with three additional values appended: the size of the resource fork
80 of the file and its 4-character creator and type.
81\end{funcdesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000082
Fred Drakefe7f3bc1998-07-23 17:55:31 +000083
Fred Drakec817e271998-08-10 18:40:22 +000084\section{\module{macpath} ---
Fred Drake59d8b731999-02-01 20:19:38 +000085 MacOS path manipulation functions}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000086
Fred Drakef6863c11999-03-02 16:37:17 +000087\declaremodule{standard}{macpath}
88% Could be labeled \platform{Mac}, but the module should work anywhere and
89% is distributed with the standard library.
Fred Drakefe7f3bc1998-07-23 17:55:31 +000090\modulesynopsis{MacOS path manipulation functions.}
91
Fred Drake55fca541998-02-18 15:21:26 +000092
Fred Drake59d8b731999-02-01 20:19:38 +000093This module is the Macintosh implementation of the \module{os.path}
Fred Drakecf282cd1999-04-28 14:04:36 +000094module. It is most portably accessed as
95\module{os.path}\refstmodindex{os.path}. Refer to the \emph{Python Library
96Reference} for documentation of \module{os.path}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000097
98The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000099\function{normcase()},
100\function{normpath()},
101\function{isabs()},
102\function{join()},
103\function{split()},
104\function{isdir()},
105\function{isfile()},
106\function{walk()},
107\function{exists()}.
Fred Drake59d8b731999-02-01 20:19:38 +0000108For other functions available in \module{os.path} dummy counterparts
Guido van Rossum66774a91996-07-21 02:20:58 +0000109are available.