Fred Drake | c817e27 | 1998-08-10 18:40:22 +0000 | [diff] [blame] | 1 | \section{\module{mac} --- |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 2 | Implementations for the \module{os} module} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 3 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 4 | \declaremodule{builtin}{mac} |
| 5 | \platform{Mac} |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 6 | \modulesynopsis{Implementations for the \module{os} module.} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 7 | |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 8 | |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 9 | This module implements the operating system dependent functionality |
| 10 | provided by the standard module \module{os}\refstmodindex{os}. It is |
| 11 | best accessed through the \module{os} module. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 12 | |
| 13 | The following functions are available in this module: |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 14 | \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()}, |
| 30 | as well as the exception \exception{error}. Note that the times |
| 31 | returned by \function{stat()} are floating-point values, like all time |
| 32 | values in MacPython. |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 33 | |
Fred Drake | 960d7a6 | 2002-02-15 14:35:09 +0000 | [diff] [blame] | 34 | One additional function is available, but only under Classic MacPython, |
| 35 | not under Carbon MacPython: |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 36 | |
| 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 Drake | 960d7a6 | 2002-02-15 14:35:09 +0000 | [diff] [blame] | 41 | 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 Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 47 | \end{funcdesc} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 48 | |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 49 | |
Fred Drake | c817e27 | 1998-08-10 18:40:22 +0000 | [diff] [blame] | 50 | \section{\module{macpath} --- |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 51 | MacOS path manipulation functions} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 52 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 53 | \declaremodule{standard}{macpath} |
| 54 | % Could be labeled \platform{Mac}, but the module should work anywhere and |
| 55 | % is distributed with the standard library. |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 56 | \modulesynopsis{MacOS path manipulation functions.} |
| 57 | |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 58 | |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 59 | This module is the Macintosh implementation of the \module{os.path} |
Fred Drake | cf282cd | 1999-04-28 14:04:36 +0000 | [diff] [blame] | 60 | module. It is most portably accessed as |
Fred Drake | e15eb35 | 1999-11-10 16:13:25 +0000 | [diff] [blame] | 61 | \module{os.path}\refstmodindex{os.path}. Refer to the |
| 62 | \citetitle[../lib/lib.html]{Python Library Reference} for |
| 63 | documentation of \module{os.path}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 64 | |
| 65 | The following functions are available in this module: |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 66 | \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 Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 75 | For other functions available in \module{os.path} dummy counterparts |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 76 | are available. |