< Previous PageNext Page > Hide TOC

Deprecated Alias Manager Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.3

GetAliasInfo

Gets information from an alias record without actually resolving the record. (Deprecated in Mac OS X v10.3. Use FSCopyAliasInfo instead.)

OSErr GetAliasInfo (
   AliasHandle alias,
   AliasInfoType index,
   Str63 theString
);

Parameters
alias

A handle to the alias record to be read.

index

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 values described in “Information Type Constants.”

theString

A string that, on return, holds the requested information.

Return Value

A result code.

Discussion

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.

The GetAliasInfo function cannot provide all kinds of information about a minimal alias.

Special Considerations

Use the FSCopyAliasInfo function instead of GetAliasInfo. GetAliasInfo does not reliably return information for aliases to items on POSIX file systems. In addition, GetAliasInfo does not support unicode names or names longer than 32 bytes. If the name of the alias target is longer than 32 bytes, the name is truncated and the file ID and extension (if any) are appended before the name is returned by GetAliasInfo.

Availability
Declared In
Aliases.h

Deprecated in Mac OS X v10.4

IsAliasFile

Determines whether a file system object is an alias file, a data file, or a folder. (Deprecated in Mac OS X v10.4. Use FSIsAliasFile instead.)

OSErr IsAliasFile (
   const FSSpec *fileFSSpec,
   Boolean *aliasFileFlag,
   Boolean *folderFlag
);

Parameters
fileFSSpec

A pointer to a file specification structure describing a file.

aliasFileFlag

A pointer to a Boolean variable. On return, a value of TRUE indicates that the object specified in the fileRef parameter is an alias file. A value of FALSE indicates that the object is not an alias file.

folderFlag

A pointer to a Boolean variable. On return, a value of TRUE indicates that the object specified in the fileRef parameter is a folder. A value of FALSE indicates that the object is a file.

Return Value

A result code.

Discussion

This function determines whether a file is an alias file.

Availability
Declared In
Aliases.h

MatchAlias

Identifies a list of possible matches for an alias and passes the list through an optional selection filter. The filter can return more than one possible match. (Deprecated in Mac OS X v10.4. Use FSMatchAliasBulk instead.)

OSErr MatchAlias (
   const FSSpec *fromFile,
   unsigned long rulesMask,
   AliasHandle alias,
   short *aliasCount,
   FSSpecArrayPtr aliasList,
   Boolean *needsUpdate,
   AliasFilterUPP aliasFilter,
   void *yourDataPtr
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you do not want MatchAlias to perform a relative search, set fromFile to NULL. If you want MatchAlias to perform a relative search, pass a pointer to a file system specification structure that describes the starting point for the search.

rulesMask

A set of rules to guide the resolution. Pass the sum of all of the rules you want to invoke. For a description of the values you can use in this parameter, see “Matching Constants.”

alias

A handle to the alias record to be resolved.

aliasCount

On input, a pointer to the maximum number of possible matches to return. On output, the actual number of matches returned.

aliasList

A pointer to the array that holds the results of the search, a list of possible candidates.

needsUpdate

A pointer to a Boolean flag that indicates whether the alias record to be resolved needs to be updated.

aliasFilter

An application-defined filter function. The Alias Manager executes this function each time it identifies a possible match and after the search has continued for three seconds without a match. Your filter function returns a Boolean value that determines whether the possible match is discarded (true) or added to the list of possible targets (false). It can also terminate the search by setting the variable parameter quitFlag. See AliasFilterProcPtr for a description of the filter function.

yourDataPtr

A pointer to data to be passed to the filter function. The yourDataPtr parameter can point to any data your application might need in the filter function.

Return Value

A result code.

Discussion

If MatchAlias finds the parent directory on the correct volume but does not find the target, it sets the aliasCount parameter to 1, puts the file system specification structure for the target in the results list, and returns fnfErr. The FSSpec structure is valid, although the object it describes does not exist. This information is intended as a "hint" that lets you explore possible solutions to the resolution failure. You can, for example, use the FSSpec structure and the File Manager function FSpCreate to create a replacement for a missing file.

After it identifies a target, MatchAlias compares some key information about the target with the same information in the record. If the information does not match, MatchAlias sets the needsUpdate flag to true. The key information is

The MatchAlias function also sets the needsUpdate flag to true if it identifies a list of possible matches rather than a single match or if kARMsearchRelFirst is set in the rulesMask parameter but the target is identified through either an absolute search or an exhaustive search. Otherwise, the MatchAlias function sets the needsUpdate flag to false. MatchAlias always sets the needsUpdate flag to false when resolving an alias created by NewAliasMinimal. If you want to update the alias record to reflect the final results of the resolution, call UpdateAlias.

Availability
Declared In
Aliases.h

NewAlias

Creates a complete alias record. (Deprecated in Mac OS X v10.4. Use FSNewAlias instead.)

OSErr NewAlias (
   const FSSpec *fromFile,
   const FSSpec *target,
   AliasHandle *alias
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you do not need relative search information in the alias record, pass a fromFile value of NULL. If you want NewAlias to record relative search information, pass a pointer to a valid FSSpec structure in this parameter. The files or directories specified in the fromFile and target parameters must reside on the same volume.

target

A pointer to an FSSpec structure for the target of the alias record.

alias

A pointer to an alias handle. On return, this handle refers to the newly created alias record. If the function fails to create an alias record, it sets alias to NULL.

Return Value

A result code.

Discussion

The NewAlias function creates an alias record that describes the specified target. It allocates the storage, fills in the record, and puts a record handle to that storage in the alias parameter. NewAlias always records the name and file or directory ID of the target, its creation date, the parent directory name and ID, and the volume name and creation date. It also records the full pathname of the target and a collection of other information relevant to locating the target, verifying the target, and mounting the target’s volume, if necessary. You can have NewAlias store relative search information as well by supplying a starting point for a relative search.

Availability
Declared In
Aliases.h

NewAliasMinimal

Creates a short alias record quickly. (Deprecated in Mac OS X v10.4. Use FSNewAliasMinimal instead.)

OSErr NewAliasMinimal (
   const FSSpec *target,
   AliasHandle *alias
);

Parameters
target

A pointer to the target of the alias record.

alias

A pointer to an alias handle. On return, this handle refers to the newly created alias record. If the function fails to create an alias record, it sets alias to NULL.

Return Value

A result code.

Discussion

The NewAliasMinimal function creates an alias record that contains only the minimum information necessary to describe the target: the target name, the parent directory ID, the volume name and creation date, and the volume mounting information. The NewAliasMinimal function uses the standard alias record data structure, but it fills in only parts of the record.

The ResolveAlias function never updates a minimal alias record.

Availability
Declared In
Aliases.h

NewAliasMinimalFromFullPath

Creates an alias record that contains only the full pathname of the target. (Deprecated in Mac OS X v10.4. Use FSNewAliasMinimal or FSNewAliasMinimalUnicode instead.)

OSErr NewAliasMinimalFromFullPath (
   short fullPathLength,
   const void *fullPath,
   ConstStr32Param zoneName,
   ConstStr31Param serverName,
   AliasHandle *alias
);

Parameters
fullPathLength

The number of characters in the full pathname of the target.

fullPath

A pointer to a buffer that contains the full pathname of the target. The full pathname starts with the name of the volume, includes all of the directory names in the path to the target, and ends with the target name. (For a description of pathnames, see the documentation for the File Manager.)

zoneName

The AppleTalk zone name of the AppleShare volume on which the target resides. Set this parameter to a null string if you do not need it.

serverName

The AppleTalk server name of the AppleShare volume on which the target resides. Set this parameter to a null string if you do not need it.

alias

A pointer to an alias handle. On return, this handle refers to the newly created alias record. If the function fails to create an alias record, it sets alias to NULL.

Return Value

A result code.

Discussion

The NewAliasMinimalFromFullPath function creates an alias record that identifies the target by full pathname. You can call NewAliasMinimalFromFullPath to create an alias record for a file that doesn’t exist or that resides on an unmounted volume.

The NewAliasMinimalFromFullPath function uses the standard alias record data structure, but it fills in only the information provided in the input parameters. You can therefore use NewAliasMinimalFromFullPath to create alias records for targets on unmounted volumes.

Availability
Declared In
Aliases.h

ResolveAlias

Identifies the single most likely target of an alias record. (Deprecated in Mac OS X v10.4. Use FSResolveAlias instead.)

OSErr ResolveAlias (
   const FSSpec *fromFile,
   AliasHandle alias,
   FSSpec *target,
   Boolean *wasChanged
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you pass a fromFile parameter of NULL, ResolveAlias performs only an absolute search. If you pass a pointer to a valid FSSpec structure in the fromFile parameter, ResolveAlias performs a relative search for the target, followed by an absolute search only if the relative search fails. If you want to perform an absolute search followed by a relative search, you must use the MatchAlias function.

alias

A handle to the alias record to be resolved and, if necessary, updated.

target

A pointer to the target of the alias record. This parameter must be a valid FSSpec structure.

wasChanged

A pointer to a Boolean value indicating whether the alias record to be resolved was updated because it contained some outdated information about the target. If it updates the alias record, ResolveAlias sets the wasChanged parameter to true. Otherwise, it sets it to false. (ResolveAlias never updates a minimal alias, so it never sets wasChanged to true when resolving a minimal alias.

Return Value

A result code.

Discussion

The ResolveAlias function performs a fast search for the target of the alias. If the resolution is successful, ResolveAlias returns (in the target parameter) the FSSpec structure for the target file system object, updates the alias record if necessary, and reports (through the wasChanged parameter) whether the record was updated. If the target is on an unmounted AppleShare volume, ResolveAlias automatically mounts the volume. If the target is on an unmounted ejectable volume, ResolveAlias asks the user to insert the volume. The ResolveAlias function exits after it finds one acceptable target.

After it identifies a target, ResolveAlias compares some key information about the target with the information in the alias record. (The description of the MatchAlias function lists the key information.) If the information differs, ResolveAlias updates the record to match the target.

When it finds the specified volume and parent directory but fails to find the target file or directory in that location, ResolveAlias returns a result code of fnfErr and fills in the target parameter with a complete FSSpec structure describing the target (that is, the volume reference number, parent directory ID, and filename or folder name). The FSSpec structure is valid, although the object it describes does not exist. This information is intended as a "hint" that lets you explore possible solutions to the resolution failure. You can, for example, pass the FSSpec structure to the File Manager function FSpCreate to create a replacement for a missing file.

The ResolveAlias function displays the standard dialog boxes when it needs input from the user, such as a name and password for mounting a remote volume. The user can cancel the resolution through these dialog boxes.

Availability
Declared In
Aliases.h

ResolveAliasFile

Resolves an alias contained in an alias file. (Deprecated in Mac OS X v10.4. Use FSResolveAliasFile instead.)

OSErr ResolveAliasFile (
   FSSpec *theSpec,
   Boolean resolveAliasChains,
   Boolean *targetIsFolder,
   Boolean *wasAliased
);

Parameters
theSpec

A pointer to the alias file you plan to open. If the function completes successfully, this FSSpec refers to the file or the directory that was referred to by the alias file.

resolveAliasChains

A Boolean value. Set this parameter to TRUE if you want ResolveAliasFile to resolve all aliases in a chain (for example, an alias file that refers to an alias file and so on), stopping only when it reaches the target file. Set this parameter to FALSE if you want to resolve only one alias file, even if the target is another alias file.

targetIsFolder

A return parameter only. The ResolveAliasFile function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to a directory or a volume; otherwise, ResolveAliasFile returns FALSE in this parameter.

wasAliased

A return parameter only. The ResolveAliasFile function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to an alias; otherwise, ResolveAliasFile returns FALSE in this parameter.

Return Value

A result code.

Discussion

If your application bypasses the Finder when manipulating documents, it should check for and resolve aliases itself by using the ResolveAliasFile function.

The ResolveAliasFile function first checks the catalog file for the file or directory specified in the parameter theSpec to determine whether it is an alias and whether it is a file or a directory. If the object is not an alias, ResolveAliasFile leaves theSpec unchanged, sets the targetIsFolder parameter to TRUE for a directory or volume and FALSE for a file, sets wasAliased to FALSE, and returns noErr. If the object is an alias, ResolveAliasFile resolves it, places the target in the parameter theSpec, and sets the wasAliased flag to TRUE.

When ResolveAliasFile finds the specified volume and parent directory but fails to find the target file or directory in that location, ResolveAliasFile returns a result code of fnfErr and fills in the parameter theSpec with a complete file system specification structure describing the target (that is, its volume reference number, parent directory ID, and filename or folder name). The file system specification structure is valid, although the object it describes does not exist. This information is intended as a "hint" that lets you explore possible solutions to the resolution failure. You can, for example, use the file system specification structure to create a replacement for a missing file with the File Manager function FSpCreate.

If ResolveAliasFile receives an error code while resolving an alias, it leaves the input parameters as they are and exits, returning an error code. ResolveAliasFile can return any Resource Manager or File Manager errors.

Special Considerations

Before calling the ResolveAliasFile function, you should make sure that it is available by using the Gestalt function with the gestaltAliasMgrAttr selector.

Availability
Declared In
Aliases.h

ResolveAliasFileWithMountFlagsNoUI

Resolves an alias file without any user interaction. (Deprecated in Mac OS X v10.4. Use FSResolveAliasFileWithMountFlags with the kResolveAliasFileNoUI flag instead.)

OSErr ResolveAliasFileWithMountFlagsNoUI (
   FSSpec *theSpec,
   Boolean resolveAliasChains,
   Boolean *targetIsFolder,
   Boolean *wasAliased,
   unsigned long mountFlags
);

Parameters
theSpec

A pointer to the alias file you plan to open. If the function completes successfully, this FSSpec refers to the file or the directory that was referred to by the alias file.

resolveAliasChains

A Boolean value. Set this parameter to TRUE if you want ResolveAliasFileWithMountFlagsNoUI to resolve all aliases in a chain (for example, an alias file that refers to an alias file and so on), stopping only when it reaches the target file. Set this parameter to FALSE if you want to resolve only one alias file, even if the target is another alias file.

targetIsFolder

A return parameter only. The ResolveAliasFileWithMountFlagsNoUI function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to a directory or a volume; otherwise, ResolveAliasFileWithMountFlagsNoUI returns FALSE in this parameter.

wasAliased

A return parameter only. The ResolveAliasFileWithMountFlagsNoUI function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to an alias; otherwise, ResolveAliasFileWithMountFlagsNoUI returns FALSE in this parameter.

mountFlags

Options controlling how the alias file is resolved. See “Volume Mount Options” for a description of the values you can use here. Set this parameter to kResolveAliasFileNoUI to prevent any user interaction, including disk switch alerts, while the alias is being resolved.

Return Value

A result code.

Discussion

The function ResolveAliasFileWithMountFlagsNoUI is identical to ResolveAliasFile with the exception that it presents no interface to the user.

Availability
Declared In
Aliases.h

ResolveAliasWithMountFlags

Identifies the target of an alias. (Deprecated in Mac OS X v10.4. Use FSResolveAliasWithMountFlags instead.)

OSErr ResolveAliasWithMountFlags (
   const FSSpec *fromFile,
   AliasHandle alias,
   FSSpec *target,
   Boolean *wasChanged,
   unsigned long mountFlags
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you pass NULL in this parameter, ResolveAliasWithMountFlags performs only an absolute search. If you pass a pointer to a valid FSSpec structure in the fromFile parameter, ResolveAliasWithMountFlags performs a relative search for the target, followed by an absolute search only if the relative search fails. If you want to perform an absolute search followed by a relative search, you must use the MatchAlias function.

alias

A handle to the alias record to be resolved and, if necessary, updated.

target

A pointer to an FSSpec structure. On return, this FSSpec identifies the target of the alias record. This parameter must point to a valid FSSpec structure.

wasChanged

A pointer to a Boolean value indicating, on return, whether the alias record to be resolved was updated because it contained some outdated information about the target. If it updates the alias record, ResolveAliasWithMountFlags sets the wasChanged parameter to true. Otherwise, it sets it to false. (ResolveAliasWithMountFlags never updates a minimal alias, so it never sets wasChanged to true when resolving a minimal alias.

mountFlags

Options controlling how the alias is resolved. See “Volume Mount Options” for a description of the values you can use here. Set this parameter to kResolveAliasFileNoUI to prevent any user interaction while the alias is being resolved.

Return Value

A result code.

Discussion

The function ResolveAliasWithMountFlags is identical to ResolveAlias with the exception that it provides the mountFlags parameter, allowing callers additional control over how the alias is resolved.

Availability
Declared In
Aliases.h

UpdateAlias

Updates an alias record. (Deprecated in Mac OS X v10.4. Use FSUpdateAlias instead.)

OSErr UpdateAlias (
   const FSSpec *fromFile,
   const FSSpec *target,
   AliasHandle alias,
   Boolean *wasChanged
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you do not need relative search information in the record, pass a fromFile value of NULL. If you want UpdateAlias to record relative search information, pass a pointer to a valid FSSpec structure in this parameter.

target

A pointer to the target of the alias record.

alias

A handle to the alias record to be updated.

wasChanged

A pointer to 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.

Return Value

A result code.

Discussion

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, specified in the fromFile and target parameters, must reside on the same volume.

Availability
Declared In
Aliases.h

Deprecated in Mac OS X v10.5

FollowFinderAlias

Resolves an alias record obtained from a Finder alias file. (Deprecated in Mac OS X v10.5. Use FSFollowFinderAlias instead.)

OSErr FollowFinderAlias (
   const FSSpec *fromFile,
   AliasHandle alias,
   Boolean logon,
   FSSpec *target,
   Boolean *wasChanged
);

Parameters
fromFile

A pointer to a file system specification specifying a file for a first attempt at a relative resolution; pass a pointer to the alias file's FSSpec forthis parameter.

alias

A handle to the alias record taken from the alias file's resources.

logon

If true, the Alias Manager attempts to mount a volume if necessary to complete the resolution of the alias.

target

A pointer to an FSSpec structure. On return, this FSSpec refers to the target found by the resolution.

wasChanged

A pointer to a Boolean value. FollowFinderAlias sets this value to true if it has updated the alias record. If the alias has been updated, you should call ChangedResource and WriteResource if the updated record should be saved in the resource file.

Return Value

A result code.

Availability
Declared In
Aliases.h

FSMatchAlias

Identifies a list of possible matches for an alias. (Deprecated in Mac OS X v10.5. Use FSMatchAliasBulk instead.)

OSErr FSMatchAlias (
   const FSRef *fromFile,
   unsigned long rulesMask,
   AliasHandle inAlias,
   short *aliasCount,
   FSRef *aliasList,
   Boolean *needsUpdate,
   AliasFilterUPP aliasFilter,
   void *yourDataPtr
);

Parameters
fromFile

A pointer to the starting point for a relative search. You may pass NULL if you do not want this function to perform a relative search.

rulesMask

A set of rules to guide the resolution. Pass the sum of all of the rules you want to invoke. For a description of the values you can use in this parameter, see “Matching Constants.”

inAlias

A handle to the alias record to be resolved.

aliasCount

On input, a pointer to the maximum number of possible matches to return. On output, the actual number of matches returned.

aliasList

A pointer to an array of FSRef structures. On return, this array holds the results of the search, a list of possible candidates.

needsUpdate

A pointer to a Boolean flag that, on return, indicates whether the alias record needs to be updated.

aliasFilter

An application-defined filter function. The Alias Manager executes this function each time it identifies a possible match. Your filter function returns a Boolean value that determines whether the possible match is discarded (true) or added to the list of possible targets (false). It can also terminate the search by setting the variable parameter quitFlag. See AliasFilterProcPtr for a description of the filter function.

yourDataPtr

A pointer to data to be passed to the filter function. The yourDataPtr parameter can point to any data your application might need in the filter function.

Return Value

A result code. When it finds the specified volume and parent directory but fails to find the target file or directory in that location, FSMatchAlias returns fnfErr. Note that the file system objects in the aliasList parameter are not valid in this case.

Discussion

After it identifies a target, FSMatchAlias compares some key information about the target with the same information in the record. If the information does not match, FSMatchAlias sets the needsUpdate flag to true.

The FSMatchAlias function also sets the needsUpdate flag to true if it identifies a list of possible matches rather than a single match or if kARMsearchRelFirst is set in the rulesMask parameter but the target is identified through either an absolute search or an exhaustive search. Otherwise, the FSMatchAlias function sets the needsUpdate flag to false. FSMatchAlias always sets the needsUpdate flag to false when resolving an alias created by FSNewAliasMinimal. If you want to update the alias record to reflect the final results of the resolution, call FSUpdateAlias.

Availability
Declared In
Aliases.h

FSMatchAliasNoUI

Identifies a list of possible matches for an alias without any user interaction. (Deprecated in Mac OS X v10.5. Use FSMatchAliasBulk with the kARMNoUI flag instead.)

OSErr FSMatchAliasNoUI (
   const FSRef *fromFile,
   unsigned long rulesMask,
   AliasHandle inAlias,
   short *aliasCount,
   FSRef *aliasList,
   Boolean *needsUpdate,
   AliasFilterUPP aliasFilter,
   void *yourDataPtr
);

Parameters
fromFile

A pointer to the starting point for a relative search. You may pass NULL if you do not want this function to perform a relative search.

rulesMask

A set of rules to guide the resolution. Pass the sum of all of the rules you want to invoke. For a description of the values you can use in this parameter, see “Matching Constants.”

inAlias

A handle to the alias record to be resolved.

aliasCount

On input, a pointer to the maximum number of possible matches to return. On output, the actual number of matches returned.

aliasList

A pointer to an array of FSRef structures. On return, this array holds the results of the search, a list of possible candidates.

needsUpdate

A pointer to a Boolean flag that, on return, indicates whether the alias record needs to be updated.

aliasFilter

An application-defined filter function. The Alias Manager executes this function each time it identifies a possible match. Your filter function returns a Boolean value that determines whether the possible match is discarded (true) or added to the list of possible targets (false). It can also terminate the search by setting the variable parameter quitFlag. See AliasFilterProcPtr for a description of the filter function.

yourDataPtr

A pointer to data to be passed to the filter function. The yourDataPtr parameter can point to any data your application might need in the filter function.

Return Value

A result code.

Discussion

The FSMatchAliasNoUI function operates in much the same way as the FSMatchAlias function; however, it does not present an interface to the user. Additionally, the FSMatchAliasNoUI function does not mount network volumes, even when it is possible to mount the volume without user interaction. See the discussion of FSMatchAlias for more information.

Availability
Declared In
Aliases.h

MatchAliasNoUI

Identifies a list of possible matches for an alias without any user interaction. (Deprecated in Mac OS X v10.5. Use FSMatchAliasBulk with the kARMNoUI flag instead.)

OSErr MatchAliasNoUI (
   const FSSpec *fromFile,
   unsigned long rulesMask,
   AliasHandle alias,
   short *aliasCount,
   FSSpecArrayPtr aliasList,
   Boolean *needsUpdate,
   AliasFilterUPP aliasFilter,
   void *yourDataPtr
);

Parameters
fromFile

A pointer to the starting point for a relative search. If you do not want MatchAliasNoUI to perform a relative search, set fromFile to NULL. If you want MatchAliasNoUI to perform a relative search, pass a pointer to a file system specification structure that describes the starting point for the search.

rulesMask

A set of rules to guide the resolution. Pass the sum of all of the rules you want to invoke. For a description of the values you can use in this parameter, see “Matching Constants.”

alias

A handle to the alias record to be resolved.

aliasCount

On input, a pointer to the maximum number of possible matches to return. On output, the actual number of matches returned.

aliasList

A pointer to the array of FSSpec structures that holds, on return, the results of the search, a list of possible candidates.

needsUpdate

A pointer to a Boolean flag that, on return, indicates whether the alias record needs to be updated.

aliasFilter

An application-defined filter function. The Alias Manager executes this function each time it identifies a possible match and after the search has continued for three seconds without a match. Your filter function returns a Boolean value that determines whether the possible match is discarded (true) or added to the list of possible targets (false). It can also terminate the search by setting the variable parameter quitFlag. See AliasFilterProcPtr for a description of the filter function.

yourDataPtr

A pointer to data to be passed to the filter function. The yourDataPtr parameter can point to any data your application might need in the filter function.

Return Value

A result code.

Discussion

The MatchAliasNoUI function operates in the same way as the MatchAlias function; however, it does not present an interface to the user. See the discussion of MatchAlias for more information.

Availability
Declared In
Aliases.h

ResolveAliasFileWithMountFlags

Resolves an alias contained in an alias file. (Deprecated in Mac OS X v10.5. Use FSResolveAliasFileWithMountFlags instead.)

OSErr ResolveAliasFileWithMountFlags (
   FSSpec *theSpec,
   Boolean resolveAliasChains,
   Boolean *targetIsFolder,
   Boolean *wasAliased,
   unsigned long mountFlags
);

Parameters
theSpec

A pointer to the alias file you plan to open. If the function completes successfully, this FSSpec refers to the file or the directory that was referred to by the alias file.

resolveAliasChains

A Boolean value. Set this parameter to TRUE if you want ResolveAliasFileWithMountFlags to resolve all aliases in a chain (for example, an alias file that refers to an alias file and so on), stopping only when it reaches the target file. Set this parameter to FALSE if you want to resolve only one alias file, even if the target is another alias file.

targetIsFolder

A return parameter only. The ResolveAliasFileWithMountFlags function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to a directory or a volume; otherwise, ResolveAliasFileWithMountFlags returns FALSE in this parameter.

wasAliased

A return parameter only. The ResolveAliasFileWithMountFlags function returns TRUE in this parameter if the file specification structure in the parameter theSpec points to an alias; otherwise, ResolveAliasFileWithMountFlags returns FALSE in this parameter.

mountFlags

Options controlling how the alias file is resolved. See “Volume Mount Options” for a description of the values you can use here. Set this parameter to kResolveAliasFileNoUI to prevent any user interaction while the alias is being resolved.

Return Value

A result code.

Discussion

The function ResolveAliasFileWithMountFlags is identical to ResolveAliasFile with the exception that it provides the mountFlags parameter.

Availability
Declared In
Aliases.h

< Previous PageNext Page > Hide TOC


© 2003, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-12-05)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.