blob: b0a3382377568f9a147276d6b9bf841763599e8f [file] [log] [blame]
Fred Drakec817e271998-08-10 18:40:22 +00001\section{\module{mac} ---
Fred Drake59d8b731999-02-01 20:19:38 +00002 Implementations for the \module{os} module}
Fred Drakefe7f3bc1998-07-23 17:55:31 +00003
Fred Drakef6863c11999-03-02 16:37:17 +00004\declaremodule{builtin}{mac}
5 \platform{Mac}
Fred Drake59d8b731999-02-01 20:19:38 +00006\modulesynopsis{Implementations for the \module{os} module.}
Fred Drakefe7f3bc1998-07-23 17:55:31 +00007
Fred Drake55fca541998-02-18 15:21:26 +00008
Fred Drake59d8b731999-02-01 20:19:38 +00009This module implements the operating system dependent functionality
10provided by the standard module \module{os}\refstmodindex{os}. It is
11best accessed through the \module{os} module.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000012
13The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000014\function{chdir()},
15\function{close()},
16\function{dup()},
17\function{fdopen()},
18\function{getcwd()},
19\function{lseek()},
20\function{listdir()},
21\function{mkdir()},
22\function{open()},
23\function{read()},
24\function{rename()},
25\function{rmdir()},
26\function{stat()},
27\function{sync()},
28\function{unlink()},
29\function{write()},
30as well as the exception \exception{error}. Note that the times
31returned by \function{stat()} are floating-point values, like all time
32values in MacPython.
Guido van Rossum7e42cab1996-10-15 14:37:31 +000033
Fred Drake960d7a62002-02-15 14:35:09 +000034One additional function is available, but only under Classic MacPython,
35not under Carbon MacPython:
Fred Drake59d8b731999-02-01 20:19:38 +000036
37\begin{funcdesc}{xstat}{path}
38 This function returns the same information as \function{stat()}, but
39 with three additional values appended: the size of the resource fork
40 of the file and its 4-character creator and type.
Fred Drake960d7a62002-02-15 14:35:09 +000041 Availability: Classic MacPython only.
42 \deprecated{2.3}{Use the \function{\refmodule{macfs}.FSSpec()}
43 function to get an FSSpec object for the file, then
44 use the \method{GetCreatorType()} method to get the
45 creator and type information. It will no longer be
46 possible to get the size of the resource fork.}
Fred Drake59d8b731999-02-01 20:19:38 +000047\end{funcdesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000048
Fred Drakefe7f3bc1998-07-23 17:55:31 +000049
Fred Drakec817e271998-08-10 18:40:22 +000050\section{\module{macpath} ---
Fred Drake59d8b731999-02-01 20:19:38 +000051 MacOS path manipulation functions}
Fred Drakefe7f3bc1998-07-23 17:55:31 +000052
Fred Drakef6863c11999-03-02 16:37:17 +000053\declaremodule{standard}{macpath}
54% Could be labeled \platform{Mac}, but the module should work anywhere and
55% is distributed with the standard library.
Fred Drakefe7f3bc1998-07-23 17:55:31 +000056\modulesynopsis{MacOS path manipulation functions.}
57
Fred Drake55fca541998-02-18 15:21:26 +000058
Fred Drake59d8b731999-02-01 20:19:38 +000059This module is the Macintosh implementation of the \module{os.path}
Fred Drakecf282cd1999-04-28 14:04:36 +000060module. It is most portably accessed as
Fred Drakee15eb351999-11-10 16:13:25 +000061\module{os.path}\refstmodindex{os.path}. Refer to the
62\citetitle[../lib/lib.html]{Python Library Reference} for
63documentation of \module{os.path}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000064
65The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +000066\function{normcase()},
67\function{normpath()},
68\function{isabs()},
69\function{join()},
70\function{split()},
71\function{isdir()},
72\function{isfile()},
73\function{walk()},
74\function{exists()}.
Fred Drake59d8b731999-02-01 20:19:38 +000075For other functions available in \module{os.path} dummy counterparts
Guido van Rossum66774a91996-07-21 02:20:58 +000076are available.