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 / Resolving and Reading Alias Records


GetAliasInfo

You use the GetAliasInfo function to get information from an alias record without actually resolving the record.

FUNCTION GetAliasInfo (alias: AliasHandle; index: AliasInfoType;
                        VAR theString: Str63): OSErr;
alias
A handle to the alias record to be read.
index
The kind of information to be retrieved.
theString
A string that holds the requested information.
DESCRIPTION
The GetAliasInfo function retrieves the information specified by the index parameter from the record pointed to by the alias parameter and places that information in the parameter theString.

The index parameter specifies the kind of information to be retrieved. If the value of index is a positive integer, GetAliasInfo retrieves the parent directory that has the same hierarchical level above the target as the index parameter (for example, an index value of 2 returns the name of the parent directory of the target's parent directory). You can therefore assemble the names of the target and all of its parent directories by making repeated calls to GetAliasInfo with incrementing index values, starting with a value of 0. When the value of index is greater than the number of levels between the target and the root, GetAliasInfo returns an empty string. You can also set the index parameter to one of the following five values:

CONST
   asiZoneName          =  -3;      {get zone name}
   asiServerName        =  -2;      {get server name}
   asiVolumeName        =  -1;      {get volume name}
   asiAliasName         =  0;       {get target name}
   asiParentName        =  1;       {get parent directory name}
Constant descriptions

asiZoneName
If the record represents a target on an AppleShare volume, retrieve the server's zone name. Otherwise, return an empty string.
asiServerName
If the record represents a target on an AppleShare volume, retrieve the server name. Otherwise, return an empty string.
asiVolumeName
Return the name of the volume on which the target resides.
asiAliasName
Return the name of the target.
asiParentName
Return the name of the parent directory of the target of the record. If the target is a volume, return the volume name.
The GetAliasInfo function returns the information stored in the alias record, which might not be current. To ensure that the information is current, you can resolve and update the alias record before calling GetAliasInfo.

Note
The GetAliasInfo function cannot provide all kinds of information about a minimal alias.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for GetAliasInfo are
Trap macroSelector
_AliasDispatch$0007

RESULT CODES
noErr0No error
paramErr-50The value of alias or theString parameter, or both, is NIL; the value of index is less than the value of asiZoneName; or the alias record is corrupt

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996