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 | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 34 | One additional function is available: |
| 35 | |
| 36 | \begin{funcdesc}{xstat}{path} |
| 37 | This function returns the same information as \function{stat()}, but |
| 38 | with three additional values appended: the size of the resource fork |
| 39 | of the file and its 4-character creator and type. |
| 40 | \end{funcdesc} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 41 | |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 42 | |
Fred Drake | c817e27 | 1998-08-10 18:40:22 +0000 | [diff] [blame] | 43 | \section{\module{macpath} --- |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 44 | MacOS path manipulation functions} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 45 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 46 | \declaremodule{standard}{macpath} |
| 47 | % Could be labeled \platform{Mac}, but the module should work anywhere and |
| 48 | % is distributed with the standard library. |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 49 | \modulesynopsis{MacOS path manipulation functions.} |
| 50 | |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 51 | |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 52 | This module is the Macintosh implementation of the \module{os.path} |
Fred Drake | cf282cd | 1999-04-28 14:04:36 +0000 | [diff] [blame] | 53 | module. It is most portably accessed as |
Fred Drake | e15eb35 | 1999-11-10 16:13:25 +0000 | [diff] [blame] | 54 | \module{os.path}\refstmodindex{os.path}. Refer to the |
| 55 | \citetitle[../lib/lib.html]{Python Library Reference} for |
| 56 | documentation of \module{os.path}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 57 | |
| 58 | The following functions are available in this module: |
Fred Drake | 55fca54 | 1998-02-18 15:21:26 +0000 | [diff] [blame] | 59 | \function{normcase()}, |
| 60 | \function{normpath()}, |
| 61 | \function{isabs()}, |
| 62 | \function{join()}, |
| 63 | \function{split()}, |
| 64 | \function{isdir()}, |
| 65 | \function{isfile()}, |
| 66 | \function{walk()}, |
| 67 | \function{exists()}. |
Fred Drake | 59d8b73 | 1999-02-01 20:19:38 +0000 | [diff] [blame] | 68 | For other functions available in \module{os.path} dummy counterparts |
Guido van Rossum | 66774a9 | 1996-07-21 02:20:58 +0000 | [diff] [blame] | 69 | are available. |