Fred Drake | c817e27 | 1998-08-10 18:40:22 +0000 | [diff] [blame] | 1 | \section{\module{macfs} --- |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 2 | Various file system services} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 3 | |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 4 | \declaremodule{standard}{macfs} |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 5 | \platform{Mac} |
Fred Drake | 72554e4 | 1998-11-25 20:07:35 +0000 | [diff] [blame] | 6 | \modulesynopsis{Support for FSSpec, the Alias Manager, |
| 7 | \program{finder} aliases, and the Standard File package.} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 8 | |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 9 | \deprecated{2.3}{The macfs module should be considered obsolete. For |
| 10 | \class{FSSpec}, \class{FSRef} and \class{Alias} handling use the |
| 11 | Carbon.File or Carbon.Folder module. For file dialogs use the |
| 12 | \module{EasyDialogs} module.} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 13 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 14 | This module provides access to Macintosh FSSpec handling, the Alias |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 15 | Manager, \program{finder} aliases and the Standard File package. |
| 16 | \index{Macintosh Alias Manager} |
| 17 | \index{Alias Manager, Macintosh} |
| 18 | \index{Standard File} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 19 | |
| 20 | Whenever a function or method expects a \var{file} argument, this |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 21 | argument can be one of three things:\ (1) a full or partial Macintosh |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 22 | pathname, (2) an \class{FSSpec} object or (3) a 3-tuple |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 23 | \code{(\var{wdRefNum}, \var{parID}, \var{name})} as described in |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 24 | \citetitle{Inside Macintosh:\ Files}. An \class{FSSpec} can point to |
Jack Jansen | d37f75b | 2002-08-06 22:15:23 +0000 | [diff] [blame] | 25 | a non-existing file, as long as the folder containing the file exists. |
| 26 | Under MacPython the same is true for a pathname, but not under unix-Pyton |
| 27 | because of the way pathnames and FSRefs works. See Apple's documentation |
| 28 | for details. |
| 29 | |
| 30 | A description of aliases and the |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 31 | Standard File package can also be found there. |
| 32 | |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 33 | \begin{funcdesc}{FSSpec}{file} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 34 | Create an \class{FSSpec} object for the specified file. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 35 | \end{funcdesc} |
| 36 | |
| 37 | \begin{funcdesc}{RawFSSpec}{data} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 38 | Create an \class{FSSpec} object given the raw data for the \C{} |
| 39 | structure for the \class{FSSpec} as a string. This is mainly useful |
| 40 | if you have obtained an \class{FSSpec} structure over a network. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 41 | \end{funcdesc} |
| 42 | |
| 43 | \begin{funcdesc}{RawAlias}{data} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 44 | Create an \class{Alias} object given the raw data for the \C{} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 45 | structure for the alias as a string. This is mainly useful if you |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 46 | have obtained an \class{FSSpec} structure over a network. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 47 | \end{funcdesc} |
| 48 | |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 49 | \begin{funcdesc}{FInfo}{} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 50 | Create a zero-filled \class{FInfo} object. |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 51 | \end{funcdesc} |
| 52 | |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 53 | \begin{funcdesc}{ResolveAliasFile}{file} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 54 | Resolve an alias file. Returns a 3-tuple \code{(\var{fsspec}, |
| 55 | \var{isfolder}, \var{aliased})} where \var{fsspec} is the resulting |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 56 | \class{FSSpec} object, \var{isfolder} is true if \var{fsspec} points |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 57 | to a folder and \var{aliased} is true if the file was an alias in the |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 58 | first place (otherwise the \class{FSSpec} object for the file itself |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 59 | is returned). |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 60 | \end{funcdesc} |
| 61 | |
Fred Drake | 4c6d21a | 2000-09-22 15:46:35 +0000 | [diff] [blame] | 62 | \begin{funcdesc}{StandardGetFile}{\optional{type, \moreargs}} |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 63 | Present the user with a standard ``open input file'' |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 64 | dialog. Optionally, you can pass up to four 4-character file types to limit |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 65 | the files the user can choose from. The function returns an \class{FSSpec} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 66 | object and a flag indicating that the user completed the dialog |
| 67 | without cancelling. |
| 68 | \end{funcdesc} |
| 69 | |
Fred Drake | 4c6d21a | 2000-09-22 15:46:35 +0000 | [diff] [blame] | 70 | \begin{funcdesc}{PromptGetFile}{prompt\optional{, type, \moreargs}} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 71 | Similar to \function{StandardGetFile()} but allows you to specify a |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 72 | prompt which will be displayed at the top of the dialog. |
Jack Jansen | 0e13374 | 1995-08-14 13:39:16 +0000 | [diff] [blame] | 73 | \end{funcdesc} |
| 74 | |
Fred Drake | 4c6d21a | 2000-09-22 15:46:35 +0000 | [diff] [blame] | 75 | \begin{funcdesc}{StandardPutFile}{prompt\optional{, default}} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 76 | Present the user with a standard ``open output file'' |
| 77 | dialog. \var{prompt} is the prompt string, and the optional |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 78 | \var{default} argument initializes the output file name. The function |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 79 | returns an \class{FSSpec} object and a flag indicating that the user |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 80 | completed the dialog without cancelling. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 81 | \end{funcdesc} |
| 82 | |
Jack Jansen | 0e13374 | 1995-08-14 13:39:16 +0000 | [diff] [blame] | 83 | \begin{funcdesc}{GetDirectory}{\optional{prompt}} |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 84 | Present the user with a non-standard ``select a directory'' dialog. You |
| 85 | have to first open the directory before clicking on the ``select current |
| 86 | directory'' button. \var{prompt} is the prompt string which will be |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 87 | displayed at the top of the dialog. Return an \class{FSSpec} object and |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 88 | a success-indicator. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 89 | \end{funcdesc} |
| 90 | |
Guido van Rossum | 910a671 | 1996-07-30 18:22:31 +0000 | [diff] [blame] | 91 | \begin{funcdesc}{SetFolder}{\optional{fsspec}} |
| 92 | Set the folder that is initially presented to the user when one of |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 93 | the file selection dialogs is presented. \var{fsspec} should point to |
Guido van Rossum | 910a671 | 1996-07-30 18:22:31 +0000 | [diff] [blame] | 94 | a file in the folder, not the folder itself (the file need not exist, |
| 95 | though). If no argument is passed the folder will be set to the |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 96 | current directory, i.e. what \function{os.getcwd()} returns. |
Guido van Rossum | 910a671 | 1996-07-30 18:22:31 +0000 | [diff] [blame] | 97 | |
| 98 | Note that starting with system 7.5 the user can change Standard File |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 99 | behaviour with the ``general controls'' control panel, thereby making |
Guido van Rossum | 910a671 | 1996-07-30 18:22:31 +0000 | [diff] [blame] | 100 | this call inoperative. |
| 101 | \end{funcdesc} |
| 102 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 103 | \begin{funcdesc}{FindFolder}{where, which, create} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 104 | Locates one of the ``special'' folders that MacOS knows about, such as |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 105 | the trash or the Preferences folder. \var{where} is the disk to |
| 106 | search, \var{which} is the 4-character string specifying which folder to |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 107 | locate. Setting \var{create} causes the folder to be created if it |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 108 | does not exist. Returns a \code{(\var{vrefnum}, \var{dirid})} tuple. |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 109 | |
| 110 | The constants for \var{where} and \var{which} can be obtained from the |
| 111 | standard module \var{Carbon.Folders}. |
Fred Drake | 2999607 | 1997-08-22 13:45:13 +0000 | [diff] [blame] | 112 | \end{funcdesc} |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 113 | |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 114 | \begin{funcdesc}{NewAliasMinimalFromFullPath}{pathname} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 115 | Return a minimal \class{alias} object that points to the given file, which |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 116 | must be specified as a full pathname. This is the only way to create an |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 117 | \class{Alias} pointing to a non-existing file. |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 118 | |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 119 | \end{funcdesc} |
| 120 | |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 121 | \begin{funcdesc}{FindApplication}{creator} |
Fred Drake | eecdc7f | 2000-10-14 04:45:22 +0000 | [diff] [blame] | 122 | Locate the application with 4-character creator code \var{creator}. The |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 123 | function returns an \class{FSSpec} object pointing to the application. |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 124 | \end{funcdesc} |
| 125 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 126 | |
Fred Drake | efff11b | 2002-01-17 04:44:34 +0000 | [diff] [blame] | 127 | \subsection{FSSpec Objects \label{fsspec-objects}} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 128 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 129 | \begin{memberdesc}[FSSpec]{data} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 130 | The raw data from the FSSpec object, suitable for passing |
| 131 | to other applications, for instance. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 132 | \end{memberdesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 133 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 134 | \begin{methoddesc}[FSSpec]{as_pathname}{} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 135 | Return the full pathname of the file described by the \class{FSSpec} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 136 | object. |
| 137 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 138 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 139 | \begin{methoddesc}[FSSpec]{as_tuple}{} |
| 140 | Return the \code{(\var{wdRefNum}, \var{parID}, \var{name})} tuple of |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 141 | the file described by the \class{FSSpec} object. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 142 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 143 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 144 | \begin{methoddesc}[FSSpec]{NewAlias}{\optional{file}} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 145 | Create an Alias object pointing to the file described by this |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 146 | FSSpec. If the optional \var{file} parameter is present the alias |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 147 | will be relative to that file, otherwise it will be absolute. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 148 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 149 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 150 | \begin{methoddesc}[FSSpec]{NewAliasMinimal}{} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 151 | Create a minimal alias pointing to this file. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 152 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 153 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 154 | \begin{methoddesc}[FSSpec]{GetCreatorType}{} |
| 155 | Return the 4-character creator and type of the file. |
| 156 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 157 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 158 | \begin{methoddesc}[FSSpec]{SetCreatorType}{creator, type} |
| 159 | Set the 4-character creator and type of the file. |
| 160 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 161 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 162 | \begin{methoddesc}[FSSpec]{GetFInfo}{} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 163 | Return a \class{FInfo} object describing the finder info for the file. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 164 | \end{methoddesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 165 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 166 | \begin{methoddesc}[FSSpec]{SetFInfo}{finfo} |
| 167 | Set the finder info for the file to the values given as \var{finfo} |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 168 | (an \class{FInfo} object). |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 169 | \end{methoddesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 170 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 171 | \begin{methoddesc}[FSSpec]{GetDates}{} |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 172 | Return a tuple with three floating point values representing the |
| 173 | creation date, modification date and backup date of the file. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 174 | \end{methoddesc} |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 175 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 176 | \begin{methoddesc}[FSSpec]{SetDates}{crdate, moddate, backupdate} |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 177 | Set the creation, modification and backup date of the file. The values |
| 178 | are in the standard floating point format used for times throughout |
| 179 | Python. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 180 | \end{methoddesc} |
Guido van Rossum | 7e42cab | 1996-10-15 14:37:31 +0000 | [diff] [blame] | 181 | |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 182 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 183 | \subsection{Alias Objects \label{alias-objects}} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 184 | |
| 185 | \begin{memberdesc}[Alias]{data} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 186 | The raw data for the Alias record, suitable for storing in a resource |
| 187 | or transmitting to other programs. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 188 | \end{memberdesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 189 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 190 | \begin{methoddesc}[Alias]{Resolve}{\optional{file}} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 191 | Resolve the alias. If the alias was created as a relative alias you |
Guido van Rossum | 6bb1adc | 1995-03-13 10:03:32 +0000 | [diff] [blame] | 192 | should pass the file relative to which it is. Return the FSSpec for |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 193 | the file pointed to and a flag indicating whether the \class{Alias} object |
Guido van Rossum | e229d86 | 1997-08-18 15:14:26 +0000 | [diff] [blame] | 194 | itself was modified during the search process. If the file does |
| 195 | not exist but the path leading up to it does exist a valid fsspec |
| 196 | is returned. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 197 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 198 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 199 | \begin{methoddesc}[Alias]{GetInfo}{num} |
| 200 | An interface to the \C{} routine \cfunction{GetAliasInfo()}. |
| 201 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 202 | |
Fred Drake | 4c6d21a | 2000-09-22 15:46:35 +0000 | [diff] [blame] | 203 | \begin{methoddesc}[Alias]{Update}{file\optional{, file2}} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 204 | Update the alias to point to the \var{file} given. If \var{file2} is |
| 205 | present a relative alias will be created. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 206 | \end{methoddesc} |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 207 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 208 | Note that it is currently not possible to directly manipulate a |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 209 | resource as an \class{Alias} object. Hence, after calling |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 210 | \method{Update()} or after \method{Resolve()} indicates that the alias |
| 211 | has changed the Python program is responsible for getting the |
Jack Jansen | 7aeba45 | 2003-02-12 09:58:33 +0000 | [diff] [blame] | 212 | \member{data} value from the \class{Alias} object and modifying the |
Fred Drake | df0e3fc | 1998-04-07 20:04:27 +0000 | [diff] [blame] | 213 | resource. |
Jack Jansen | e4be9be | 1995-02-28 15:46:09 +0000 | [diff] [blame] | 214 | |
| 215 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 216 | \subsection{FInfo Objects \label{finfo-objects}} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 217 | |
Fred Drake | e15eb35 | 1999-11-10 16:13:25 +0000 | [diff] [blame] | 218 | See \citetitle{Inside Macintosh: Files} for a complete description of what |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 219 | the various fields mean. |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 220 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 221 | \begin{memberdesc}[FInfo]{Creator} |
| 222 | The 4-character creator code of the file. |
| 223 | \end{memberdesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 224 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 225 | \begin{memberdesc}[FInfo]{Type} |
| 226 | The 4-character type code of the file. |
| 227 | \end{memberdesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 228 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 229 | \begin{memberdesc}[FInfo]{Flags} |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 230 | The finder flags for the file as 16-bit integer. The bit values in |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 231 | \var{Flags} are defined in standard module \module{MACFS}. |
| 232 | \end{memberdesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 233 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 234 | \begin{memberdesc}[FInfo]{Location} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 235 | A Point giving the position of the file's icon in its folder. |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 236 | \end{memberdesc} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 237 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 238 | \begin{memberdesc}[FInfo]{Fldr} |
Jack Jansen | e164bd8 | 1995-08-10 11:53:14 +0000 | [diff] [blame] | 239 | The folder the file is in (as an integer). |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 240 | \end{memberdesc} |