Mercurial > cpython-lru_cache-weakref
annotate Doc/libmacfs.tex @ 3720:b341def4eef8 legacy-trunk
Ignore latex intermediate products.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 26 Jun 1996 19:30:01 +0000 |
| parents | 05aeb91e3b90 |
| children | 83a95bf70867 |
| rev | line source |
|---|---|
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
1 \section{Built-in Module \sectcode{macfs}} |
| 2452 | 2 \bimodindex{macfs} |
| 3 | |
|
2453
cdd3a721b40e
a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents:
2452
diff
changeset
|
4 \renewcommand{\indexsubitem}{(in module macfs)} |
|
cdd3a721b40e
a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents:
2452
diff
changeset
|
5 |
| 2452 | 6 This module provides access to macintosh FSSpec handling, the Alias |
| 7 Manager, finder aliases and the Standard File package. | |
| 8 | |
| 9 Whenever a function or method expects a \var{file} argument, this | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
10 argument can be one of three things:\ (1) a full or partial Macintosh |
| 2452 | 11 pathname, (2) an FSSpec object or (3) a 3-tuple \code{(wdRefNum, |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
12 parID, name)} as described in Inside Mac VI\@. A description of aliases |
| 2452 | 13 and the standard file package can also be found there. |
| 14 | |
| 15 \begin{funcdesc}{FSSpec}{file} | |
| 16 Create an FSSpec object for the specified file. | |
| 17 \end{funcdesc} | |
| 18 | |
| 19 \begin{funcdesc}{RawFSSpec}{data} | |
| 20 Create an FSSpec object given the raw data for the C structure for the | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
21 FSSpec as a string. This is mainly useful if you have obtained an |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
22 FSSpec structure over a network. |
| 2452 | 23 \end{funcdesc} |
| 24 | |
| 25 \begin{funcdesc}{RawAlias}{data} | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
26 Create an Alias object given the raw data for the C structure for the |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
27 alias as a string. This is mainly useful if you have obtained an |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
28 FSSpec structure over a network. |
| 2452 | 29 \end{funcdesc} |
| 30 | |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
31 \begin{funcdesc}{FInfo}{} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
32 Create a zero-filled FInfo object. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
33 \end{funcdesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
34 |
| 2452 | 35 \begin{funcdesc}{ResolveAliasFile}{file} |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
36 Resolve an alias file. Returns a 3-tuple \code{(\var{fsspec}, \var{isfolder}, |
|
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
37 \var{aliased})} where \var{fsspec} is the resulting FSSpec object, |
| 2452 | 38 \var{isfolder} is true if \var{fsspec} points to a folder and |
| 39 \var{aliased} is true if the file was an alias in the first place | |
| 40 (otherwise the FSSpec object for the file itself is returned). | |
| 41 \end{funcdesc} | |
| 42 | |
| 43 \begin{funcdesc}{StandardGetFile}{\optional{type\, ...}} | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
44 Present the user with a standard ``open input file'' |
| 2452 | 45 dialog. Optionally, you can pass up to four 4-char file types to limit |
| 46 the files the user can choose from. The function returns an FSSpec | |
| 47 object and a flag indicating that the user completed the dialog | |
| 48 without cancelling. | |
| 49 \end{funcdesc} | |
| 50 | |
|
2994
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
51 \begin{funcdesc}{PromptGetFile}{prompt\optional{\, type\, ...}} |
|
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
52 Similar to \var{StandardGetFile} but allows you to specify a prompt. |
|
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
53 \end{funcdesc} |
|
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
54 |
| 2452 | 55 \begin{funcdesc}{StandardPutFile}{prompt\, \optional{default}} |
| 56 Present the user with a standard ``open output file'' | |
| 57 dialog. \var{prompt} is the prompt string, and the optional | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
58 \var{default} argument initializes the output file name. The function |
| 2452 | 59 returns an FSSpec object and a flag indicating that the user completed |
| 60 the dialog without cancelling. | |
| 61 \end{funcdesc} | |
| 62 | |
|
2994
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
63 \begin{funcdesc}{GetDirectory}{\optional{prompt}} |
| 2452 | 64 Present the user with a non-standard ``select a directory'' |
|
2994
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
65 dialog. \var{prompt} is the prompt string, and the optional. |
|
ac0152f63bdd
Documented PromptGetFile and optional prompt to GetDirectory.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2941
diff
changeset
|
66 Return an FSSpec object and a success-indicator. |
| 2452 | 67 \end{funcdesc} |
| 68 | |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
69 \begin{funcdesc}{FindFolder}{where\, which\, create} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
70 Locates one of the ``special'' folders that MacOS knows about, such as |
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
71 the trash or the Preferences folder. \var{Where} is the disk to |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
72 search, \var{which} is the 4-char string specifying which folder to |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
73 locate. Setting \var{create} causes the folder to be created if it |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
74 does not exist. Returns a \code{(vrefnum, dirid)} tuple. |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
75 |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
76 The constants for \var{where} and \var{which} can be obtained from the |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
77 standard module \var{MACFS}. |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
78 \end{funcdesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
79 |
| 2452 | 80 \subsection{FSSpec objects} |
| 81 | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
82 \renewcommand{\indexsubitem}{(FSSpec object attribute)} |
| 2452 | 83 \begin{datadesc}{data} |
| 84 The raw data from the FSSpec object, suitable for passing | |
| 85 to other applications, for instance. | |
| 86 \end{datadesc} | |
| 87 | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
88 \renewcommand{\indexsubitem}{(FSSpec object method)} |
| 2452 | 89 \begin{funcdesc}{as_pathname}{} |
| 90 Return the full pathname of the file described by the FSSpec object. | |
| 91 \end{funcdesc} | |
| 92 | |
| 93 \begin{funcdesc}{as_tuple}{} | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
94 Return the \code{(\var{wdRefNum}, \var{parID}, \var{name})} tuple of the file described |
| 2452 | 95 by the FSSpec object. |
| 96 \end{funcdesc} | |
| 97 | |
| 98 \begin{funcdesc}{NewAlias}{\optional{file}} | |
| 99 Create an Alias object pointing to the file described by this | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
100 FSSpec. If the optional \var{file} parameter is present the alias |
| 2452 | 101 will be relative to that file, otherwise it will be absolute. |
| 102 \end{funcdesc} | |
| 103 | |
| 104 \begin{funcdesc}{NewAliasMinimal}{} | |
| 105 Create a minimal alias pointing to this file. | |
| 106 \end{funcdesc} | |
| 107 | |
| 108 \begin{funcdesc}{GetCreatorType}{} | |
| 109 Return the 4-char creator and type of the file. | |
| 110 \end{funcdesc} | |
| 111 | |
| 112 \begin{funcdesc}{SetCreatorType}{creator\, type} | |
| 113 Set the 4-char creator and type of the file. | |
| 114 \end{funcdesc} | |
| 115 | |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
116 \begin{funcdesc}{GetFInfo}{} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
117 Return a FInfo object describing the finder info for the file. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
118 \end{funcdesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
119 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
120 \begin{funcdesc}{SetFInfo}{finfo} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
121 Set the finder info for the file to the values specified in the |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
122 \var{finfo} object. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
123 \end{funcdesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
124 |
| 2452 | 125 \subsection{alias objects} |
| 126 | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
127 \renewcommand{\indexsubitem}{(alias object attribute)} |
| 2452 | 128 \begin{datadesc}{data} |
| 129 The raw data for the Alias record, suitable for storing in a resource | |
| 130 or transmitting to other programs. | |
| 131 \end{datadesc} | |
| 132 | |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
133 \renewcommand{\indexsubitem}{(alias object method)} |
| 2452 | 134 \begin{funcdesc}{Resolve}{\optional{file}} |
| 135 Resolve the alias. If the alias was created as a relative alias you | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
136 should pass the file relative to which it is. Return the FSSpec for |
| 2452 | 137 the file pointed to and a flag indicating whether the alias object |
| 138 itself was modified during the search process. | |
| 139 \end{funcdesc} | |
| 140 | |
| 141 \begin{funcdesc}{GetInfo}{num} | |
| 142 An interface to the C routine \code{GetAliasInfo()}. | |
| 143 \end{funcdesc} | |
| 144 | |
| 145 \begin{funcdesc}{Update}{file\, \optional{file2}} | |
| 146 Update the alias to point to the \var{file} given. If \var{file2} is | |
| 147 present a relative alias will be created. | |
| 148 \end{funcdesc} | |
| 149 | |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
150 Note that it is currently not possible to directly manipulate a resource |
| 2452 | 151 as an alias object. Hence, after calling \var{Update} or after |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2453
diff
changeset
|
152 \var{Resolve} indicates that the alias has changed the Python program |
| 2452 | 153 is responsible for getting the \var{data} from the alias object and |
| 154 modifying the resource. | |
| 155 | |
| 156 | |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
157 \subsection{FInfo objects} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
158 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
159 See Inside Mac for a complete description of what the various fields |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
160 mean. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
161 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
162 \renewcommand{\indexsubitem}{(FInfo object attribute)} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
163 \begin{datadesc}{Creator} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
164 The 4-char creator code of the file. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
165 \end{datadesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
166 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
167 \begin{datadesc}{Type} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
168 The 4-char type code of the file. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
169 \end{datadesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
170 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
171 \begin{datadesc}{Flags} |
|
3194
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
172 The finder flags for the file as 16-bit integer. The bit values in |
|
05aeb91e3b90
Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2994
diff
changeset
|
173 \var{Flags} are defined in standard module \var{MACFS}. |
|
2941
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
174 \end{datadesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
175 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
176 \begin{datadesc}{Location} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
177 A Point giving the position of the file's icon in its folder. |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
178 \end{datadesc} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
179 |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
180 \begin{datadesc}{Fldr} |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
181 The folder the file is in (as an integer). |
|
97f7cfabe07e
Documented FindFolder, GetFInfo, SetFInfo and the FInfo object.
Jack Jansen <jack.jansen@cwi.nl>
parents:
2576
diff
changeset
|
182 \end{datadesc} |
