Important: The information in this document is obsolete and should not be used for new development.
GetAliasInfo
You use theGetAliasInfo
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
TheGetAliasInfo
function retrieves the information specified by theindex
parameter from the record pointed to by thealias
parameter and places that information in the parametertheString
.The
index
parameter specifies the kind of information to be retrieved. If the value ofindex
is a positive integer,GetAliasInfo
retrieves the parent directory that has the same hierarchical level above the target as the index parameter (for example, anindex
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 toGetAliasInfo
with incrementing index values, starting with a value of 0. When the value ofindex
is greater than the number of levels between the target and the root,GetAliasInfo
returns an empty string. You can also set theindex
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
The
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.
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 callingGetAliasInfo
.
- Note
- The
GetAliasInfo
function cannot provide all kinds of information about a minimal alias.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forGetAliasInfo
are
Trap macro Selector _AliasDispatch $0007 RESULT CODES
noErr 0 No error paramErr -50 The value of alias
ortheString
parameter, or both, isNIL
; the value ofindex
is less than the value ofasiZoneName
; or the alias record is corrupt