Important: The information in this document is obsolete and should not be used for new development.
UpdateAlias
You use theUpdateAliasfunction to update an alias record.
FUNCTION UpdateAlias (fromFile: FSSpecPtr; target: FSSpec; alias: AliasHandle; VAR wasChanged: Boolean): OSErr;
fromFile- The starting point for a relative path, to be used later in a relative
search. If you do not need relative path information in the record, pass
afromFilevalue ofNIL. If you wantUpdateAliasto record
relative path information, pass a pointer to a validFSSpecrecord
in this parameter.target- The target of the alias record. This parameter must be a valid
FSSpecrecord.alias- A handle to the alias record to be updated.
wasChanged- A Boolean value indicating whether the newly constructed alias record is exactly the same as the old one. If the new record is the same as the old one,
UpdateAliassets thewasChangedparameter toFALSE. Otherwise, it sets it toTRUE. Check this parameter to determine whether you need to save an updated record.DESCRIPTION
TheUpdateAliasfunction updates the alias record pointed to by thealiasparameter so that it describes the target specified by thetargetparameter. TheUpdateAliasfunction rebuilds the entire alias record and fills it in as theNewAliasfunction would.The
UpdateAliasfunction always creates a complete alias record. When you useUpdateAliasto update a minimal alias record, you convert the minimal record to a complete record.SPECIAL CONSIDERATIONS
The two files or directories,fromFileandtarget, must reside on the same volume.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forUpdateAliasare
Trap macro Selector _AliasDispatch $0006 RESULT CODES
noErr 0 No error paramErr -50 The value of the targetoraliasparameter, or both, isNIL, or the alias record is corrupt