blob: 86d108a64dd5a72a910c72faff26e11add5c9298 [file] [log] [blame]
Jack Jansene4be9be1995-02-28 15:46:09 +00001\section{Built-in module \sectcode{macfs}}
2\bimodindex{macfs}
3
4This module provides access to macintosh FSSpec handling, the Alias
5Manager, finder aliases and the Standard File package.
6
7Whenever a function or method expects a \var{file} argument, this
8argument can be one of three things: (1) a full or partial macintosh
9pathname, (2) an FSSpec object or (3) a 3-tuple \code{(wdRefNum,
10parID, name)} as described in Inside Mac VI. A description of aliases
11and the standard file package can also be found there.
12
13\begin{funcdesc}{FSSpec}{file}
14Create an FSSpec object for the specified file.
15\end{funcdesc}
16
17\begin{funcdesc}{RawFSSpec}{data}
18Create an FSSpec object given the raw data for the C structure for the
19FSSpec.
20\end{funcdesc}
21
22\begin{funcdesc}{RawAlias}{data}
23Create an Alias object given the raw data for the alias.
24\end{funcdesc}
25
26\begin{funcdesc}{ResolveAliasFile}{file}
27Resolve an alias file. Returns a 3-tuple \code{(fsspec, isfolder,
28aliased)} where \var{fsspec} is the resulting FSSpec object,
29\var{isfolder} is true if \var{fsspec} points to a folder and
30\var{aliased} is true if the file was an alias in the first place
31(otherwise the FSSpec object for the file itself is returned).
32\end{funcdesc}
33
34\begin{funcdesc}{StandardGetFile}{\optional{type\, ...}}
35Present the user with a standard ``open onput file''
36dialog. Optionally, you can pass up to four 4-char file types to limit
37the files the user can choose from. The function returns an FSSpec
38object and a flag indicating that the user completed the dialog
39without cancelling.
40\end{funcdesc}
41
42\begin{funcdesc}{StandardPutFile}{prompt\, \optional{default}}
43Present the user with a standard ``open output file''
44dialog. \var{prompt} is the prompt string, and the optional
45\var{default} argument initialized the output file name. The function
46returns an FSSpec object and a flag indicating that the user completed
47the dialog without cancelling.
48\end{funcdesc}
49
50\begin{funcdesc}{GetDirectory}{}
51Present the user with a non-standard ``select a directory''
52dialog. Returns an FSSpec object and a success-indicator.
53\end{funcdesc}
54
55\subsection{FSSpec objects}
56
57\renewcommand{\indexsubitem}{(FSSpec object method)}
58\begin{datadesc}{data}
59The raw data from the FSSpec object, suitable for passing
60to other applications, for instance.
61\end{datadesc}
62
63\begin{funcdesc}{as_pathname}{}
64Return the full pathname of the file described by the FSSpec object.
65\end{funcdesc}
66
67\begin{funcdesc}{as_tuple}{}
68Return the \code{(wdRefNum, parID, name)} tuple of the file described
69by the FSSpec object.
70\end{funcdesc}
71
72\begin{funcdesc}{NewAlias}{\optional{file}}
73Create an Alias object pointing to the file described by this
74FSSpec. If the optional \code{file} parameter is present the alias
75will be relative to that file, otherwise it will be absolute.
76\end{funcdesc}
77
78\begin{funcdesc}{NewAliasMinimal}{}
79Create a minimal alias pointing to this file.
80\end{funcdesc}
81
82\begin{funcdesc}{GetCreatorType}{}
83Return the 4-char creator and type of the file.
84\end{funcdesc}
85
86\begin{funcdesc}{SetCreatorType}{creator\, type}
87Set the 4-char creator and type of the file.
88\end{funcdesc}
89
90\subsection{alias objects}
91
92\renewcommand{\indexsubitem}{(alias object method)}
93\begin{datadesc}{data}
94The raw data for the Alias record, suitable for storing in a resource
95or transmitting to other programs.
96\end{datadesc}
97
98\begin{funcdesc}{Resolve}{\optional{file}}
99Resolve the alias. If the alias was created as a relative alias you
100should pass the file relative to which it is. Returns the FSSpec for
101the file pointed to and a flag indicating whether the alias object
102itself was modified during the search process.
103\end{funcdesc}
104
105\begin{funcdesc}{GetInfo}{num}
106An interface to the C routine \code{GetAliasInfo()}.
107\end{funcdesc}
108
109\begin{funcdesc}{Update}{file\, \optional{file2}}
110Update the alias to point to the \var{file} given. If \var{file2} is
111present a relative alias will be created.
112\end{funcdesc}
113
114Note that is currently not possible to directly manipulate a resource
115as an alias object. Hence, after calling \var{Update} or after
116\var{Resolve} indicates that the alias has changed the python program
117is responsible for getting the \var{data} from the alias object and
118modifying the resource.
119
120