GetAliasInfo
GetAliasInfo Get information from an AliasRecord
#include <Aliases.h> Alias Manager
OSErr GetAliasInfo( alias, index, theString);
AliasHandle alias ; a handle to the AliasRecord to be read
AliasInfoType index ; information retrieval specification (see below)
Str63 theString ; receives requested information
returns Error Code; 0=no error
You use the GetAliasInfo function to get information from an AliasRecord
without actually resolving the record.
alias is a handle to the AliasRecord to be read.
index specifies the kind of information to be retrieved. If 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 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.
Constant Description
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.
theString receives the requested information.
Returns: an operating system Error Code.
noErr (0) No error
nsvErr (-35) The volume is not mounted
fnfErr (-43) Target not found, but volume and parent directory
found; if aliasCount is 1, target parameter contains a
valid FSSpec record
paramErr (-50) Alias, theString, or both are NIL, the index is less than
asiZoneName, or the AliasRecord is corrupt

Notes: GetAliasInfo returns the information stored in the AliasRecord, which
might not be current. To ensure that the information is current, you can
resolve and update the AliasRecord before calling GetAliasInfo.
GetAliasInfo cannot provide all kinds of information on a minimal alias.