Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 4 - Alias Manager / Alias Manager Reference
Alias Manager Routines / Creating and Updating Alias Records


UpdateAlias

You use the UpdateAlias function 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
a fromFile value of NIL. If you want UpdateAlias to record
relative path information, pass a pointer to a valid FSSpec record
in this parameter.
target
The target of the alias record. This parameter must be a valid
FSSpec record.
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, UpdateAlias sets the wasChanged parameter to FALSE. Otherwise, it sets it to TRUE. Check this parameter to determine whether you need to save an updated record.
DESCRIPTION
The UpdateAlias function updates the alias record pointed to by the alias parameter so that it describes the target specified by the target parameter. The UpdateAlias function rebuilds the entire alias record and fills it in as the NewAlias function would.

The UpdateAlias function always creates a complete alias record. When you use UpdateAlias to update a minimal alias record, you convert the minimal record to a complete record.

SPECIAL CONSIDERATIONS
The two files or directories, fromFile and target, must reside on the same volume.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for UpdateAlias are
Trap macroSelector
_AliasDispatch$0006

RESULT CODES
noErr0No error
paramErr-50The value of the target or alias parameter, or both, is NIL, or the alias record is corrupt

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996