Deprecated Alias Manager Functions

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

Deprecated in OS X v10.3

GetAliasInfo

Gets information from an alias record without actually resolving the record. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.3.
  • Not available to 64-bit applications.
Related Sample Code
Declared In
Aliases.h

Deprecated in OS X v10.4

IsAliasFile

Determines whether a file system object is an alias file, a data file, or a folder. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
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 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 FSAliasFilterProcPtr 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 name of the target

  • the directory ID of the target’s parent

  • the file ID or directory ID of the target

  • the name and creation date of the volume on which the target resides

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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

NewAlias

Creates a complete alias record. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

NewAliasMinimal

Creates a short alias record quickly. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

NewAliasMinimalFromFullPath

Creates an alias record that contains only the full pathname of the target. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

ResolveAlias

Identifies the single most likely target of an alias record. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

ResolveAliasFile

Resolves an alias contained in an alias file. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

ResolveAliasFileWithMountFlagsNoUI

Resolves an alias file without any user interaction. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

ResolveAliasWithMountFlags

Identifies the target of an alias. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

UpdateAlias

Updates an alias record. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
Aliases.h

Deprecated in OS X v10.5

FollowFinderAlias

Resolves an alias record obtained from a Finder alias file. (Deprecated in 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 for this 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.5.
  • Not available to 64-bit applications.
Declared In
Aliases.h

FSMatchAlias

Identifies a list of possible matches for an alias. (Deprecated in 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 FSAliasFilterProcPtr 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
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.5.
  • Not available to 64-bit applications.
Declared In
Aliases.h

FSMatchAliasNoUI

Identifies a list of possible matches for an alias without any user interaction. (Deprecated in 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 FSAliasFilterProcPtr 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
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.5.
  • Not available to 64-bit applications.
Declared In
Aliases.h

MatchAliasNoUI

Identifies a list of possible matches for an alias without any user interaction. (Deprecated in 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 FSAliasFilterProcPtr 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.5.
  • Not available to 64-bit applications.
Declared In
Aliases.h

ResolveAliasFileWithMountFlags

Resolves an alias contained in an alias file. (Deprecated in 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
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.5.
  • Not available to 64-bit applications.
Declared In
Aliases.h

Deprecated in OS X v10.8

DisposeAliasFilterUPP

Disposes of a universal procedure pointer (UPP) to an alias filtering callback function. (Deprecated in OS X v10.8.)

void DisposeAliasFilterUPP (
   AliasFilterUPP userUPP
);
Parameters
userUPP

The UPP to dispose of.

Discussion

See FSAliasFilterProcPtr for more information on alias filtering callback functions.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
  • Not available to 64-bit applications.
Declared In
Aliases.h

FSCopyAliasInfo

Returns information from an alias handle. (Deprecated in OS X v10.8. Use CFURLCreateResourcePropertiesForKeysFromBookmarkData or CFURLCreateResourcePropertyForKeyFromBookmarkData.)

OSStatus FSCopyAliasInfo (
   AliasHandle inAlias,
   HFSUniStr255 *targetName,
   HFSUniStr255 *volumeName,
   CFStringRef *pathString,
   FSAliasInfoBitmap *whichInfo,
   FSAliasInfo *info
);
Parameters
inAlias

A handle to the alias record from which to get information.

targetName

A pointer to a string that, on return, contains the name of the target item. Pass NULL if you do not want this information returned.

volumeName

A pointer to a string that, on return, contains the name of the volume the target resides on. Pass NULL if you do not want this information returned.

pathString

A pointer a CFString that, on return, contains the POSIX path to the target. Pass NULL if you do not want this information returned.

whichInfo

A pointer to a variable of type FSAliasInfoBitmap. On return, this field indicates which fields in the alias information block, specified in the info parameter, contain valid data. See “Alias Information Masks” for a description of the values that may be returned here. This parameter may be NULL.

info

A pointer to a structure of type FSAliasInfo. On return, this structure contains information about the alias. Pass NULL if you do not want this information returned.

Return Value

A result code.

Discussion

This function returns the requested information from the alias handle passed in the inAlias parameter. The information is gathered only from the alias record, so it may not match what is on disk. No disk input/output is performed.

The FSCopyAliasInfo function adds support for unicode filenames and filenames longer than 32 bytes. It replaces the GetAliasInfo function.

Availability
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
Aliases.h

FSFollowFinderAlias

Resolves an alias record obtained from a Finder alias file. (Deprecated in OS X v10.8. First use CFURLCreateBookmarkDataFromFile, then use CFURLCreateByResolvingBookmarkData.)

OSErr FSFollowFinderAlias (
   FSRef *fromFile,
   AliasHandle alias,
   Boolean logon,
   FSRef *target,
   Boolean *wasChanged
);
Parameters
fromFile

A pointer to the file to use for a first attempt at a relative resolution; pass a pointer to the alias file's FSRef for this 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 FSRef structure. On return, this FSRef refers to the target found by the resolution.

wasChanged

A pointer to a Boolean value. FSFollowFinderAlias sets this value to true if it has updated the alias record.

Return Value

A result code.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSIsAliasFile

Determines whether a file system object is an alias file, a data file, or a folder. (Deprecated in OS X v10.8. Use CFURLCopyResourcePropertyForKey with kCFURLIsAliasFileKey instead.)

OSErr FSIsAliasFile (
   const FSRef *fileRef,
   Boolean *aliasFileFlag,
   Boolean *folderFlag
);
Parameters
fileRef

A pointer to the file system object to test.

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

Table A-1 summarizes the information that this function provides about the object specified in the fileRef parameter:

Table A-1  Information about a file system object

Alias flag

Folder flag

Object kind

T

F

Alias file

F

F

Data file

F

T

Folder

Note that if fileRef is an alias file, this function does not provide any information about the object to which the alias refers. To find out whether this object is a file or a folder, you can use FSResolveAliasFile.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
Aliases.h

FSMatchAliasBulk

Identifies a list of possible matches for an alias. (Deprecated in OS X v10.8. This API does not scale to volumes that contain large numbers of file system objects. To search for files that match specific properties, use Spotlight functionality instead (to learn more about Spotlight, see Spotlight Overview).)

OSStatus FSMatchAliasBulk (
   const FSRef *fromFile,
   unsigned long rulesMask,
   AliasHandle inAlias,
   short *aliasCount,
   FSRef *aliasList,
   Boolean *needsUpdate,
   FSAliasFilterProcPtr 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. By default, this function performs a relative search only if the absolute search does not find a match. If you want to perform the relative search first, you should pass kARMSearchRelFirst in the rulesMask parameter.

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 output, this array holds the results of the search, a list of possible candidates.

needsUpdate

A pointer to a Boolean flag that, on output, indicates whether the alias record needs to be updated. For more information about this parameter, see the Discussion.

aliasFilter

An optional application-defined filter function. The Alias Manager calls your filter function each time it identifies a possible match or 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 FSAliasFilterProcPtr for a description of the filter function.

yourDataPtr

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

Return Value

A result code. If the Alias Manager finds the specified volume and parent directory but fails to find the target file or directory in that location, the return value is fnfErr and the elements in the aliasList parameter are not valid.

Discussion

After it identifies a target, this function compares some key information about the target with the same information in the record. If the information does not match, this function sets the needsUpdate flag to true. This 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, this function sets the needsUpdate flag to false. This function always sets the needsUpdate flag to false when resolving an alias created by FSNewAliasMinimal. To update the alias record to reflect the final results of the resolution, use the function FSUpdateAlias.

Availability
  • Available in OS X v10.5 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSNewAlias

Creates a new alias record, given a target file or directory. (Deprecated in OS X v10.8. Use CFURLCreateBookmarkData instead.)

OSErr FSNewAlias (
   const FSRef *fromFile,
   const FSRef *target,
   AliasHandle *inAlias
);
Parameters
fromFile

A pointer to the starting point for a relative search. You may pass NULL if you do not need relative search information in the alias record. The files or directories specified in the fromFile and target parameters must reside on the same volume.

target

A pointer to the target file or directory of the alias.

inAlias

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 inAlias to NULL.

Return Value

A result code. If the specified target is valid, this function creates an alias record for the target and returns noErr. Any other return value indicates that this function did not create an alias record.

Discussion

The FSNewAlias 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 inAlias parameter. FSNewAlias 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 FSNewAlias store relative search information as well by supplying a starting point for a relative search.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
Aliases.h

FSNewAliasFromPath

Creates a new alias record, given the pathname of the target file or directory. (Deprecated in OS X v10.8. Use CFURLCreateBookmarkData instead.)

OSErr FSNewAliasFromPath (
   const char *fromFilePath,
   const char *targetPath,
   OptionBits flags,
   AliasHandle *inAlias,
   Boolean *isDirectory
);
Parameters
fromFilePath

A C string that specifies the starting point for a relative search. The string should contain a UTF-8 pathname. You may pass NULL if you do not need relative search information in the alias record.

targetPath

A C string that contains the full UTF-8 pathname of the target object.

flags

Reserved for future use. Currently, you should pass 0.

inAlias

A pointer to an alias handle. On output, this handle refers to the newly created alias record.

isDirectory

A pointer to a Boolean value. On input, if the target does not exist, set the value to true if the target is a directory or false if it is not. (Pass NULL if you are not sure whether the target is a directory.) On output, if the target exists, the value is true if the target is a directory, false if it is not.

Return Value

A result code. For more information, see the Discussion.

Discussion

If the specified target exists, this function creates an alias record for the target and returns noErr. If the parent directory specified in the target pathname exists but the target itself does not exist, this function creates an alias record for the target and returns fnfErr. Any other return value indicates that this function did not create an alias record.

Availability
  • Available in OS X v10.5 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSNewAliasMinimal

Creates a new minimal alias record, given a target file or directory. (Deprecated in OS X v10.8. Use CFURLCreateBookmarkData instead.)

OSErr FSNewAliasMinimal (
   const FSRef *target,
   AliasHandle *inAlias
);
Parameters
target

A pointer to the target of the alias record.

inAlias

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 inAlias to NULL.

Return Value

A result code. If the specified target is valid, this function creates an alias record for the target and returns noErr. Any other return value indicates that this function did not create an alias record.

Discussion

The FSNewAliasMinimal function creates an alias record that contains only the minimum information necessary to describe the target. The FSNewAliasMinimal function uses the standard alias record data structure, but it fills in only parts of the record.

The FSResolveAlias function never updates a minimal alias record.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSNewAliasMinimalUnicode

Creates a minimal alias, given the Unicode name and parent directory of the target. (Deprecated in OS X v10.8. Use CFURLCreateBookmarkData instead.)

OSErr FSNewAliasMinimalUnicode (
   const FSRef *targetParentRef,
   UniCharCount targetNameLength,
   const UniChar *targetName,
   AliasHandle *inAlias,
   Boolean *isDirectory
);
Parameters
targetParentRef

A pointer to the parent directory of the target.

targetNameLength

The number of Unicode characters in the target's name.

targetName

A pointer to the Unicode name of the target.

inAlias

A pointer to an alias handle. On return, this handle refers to the newly created alias record.

isDirectory

A pointer to a Boolean value. On input, if the target does not exist, set the value to true if the target is a directory or false if it is not. (Pass NULL if you are not sure whether the target is a directory.) On output, if the target exists, the value is true if the target is a directory, false if it is not.

Return Value

A result code. For more information, see the Discussion.

Discussion

If the specified target exists, this function creates an alias record for the target and returns noErr. If the parent directory exists but the target itself does not exist, this function creates an alias record for the target and returns fnfErr. Any other return value indicates that this function did not create an alias record.

Availability
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSNewAliasUnicode

Creates a new alias record, given the Unicode name and parent directory of the target. (Deprecated in OS X v10.8. Use CFURLCreateBookmarkData instead.)

OSErr FSNewAliasUnicode (
   const FSRef *fromFile,
   const FSRef *targetParentRef,
   UniCharCount targetNameLength,
   const UniChar *targetName,
   AliasHandle *inAlias,
   Boolean *isDirectory
);
Parameters
fromFile

A pointer to the starting point for a relative search. You may pass NULL if you do not need relative search information in the alias record.

targetParentRef

A pointer to the parent directory of the target.

targetNameLength

The number of Unicode characters in the target's name.

targetName

A pointer to the Unicode name of the target.

inAlias

A pointer to an alias handle. On return, this handler refers to the newly created alias record.

isDirectory

A pointer to a Boolean value. On input, if the target does not exist, set the value to true if the target is a directory or false if it is not. (Pass NULL if you are not sure whether the target is a directory.) On output, if the target exists, the value is true if the target is a directory, false if it is not.

Return Value

A result code. For more information, see the Discussion.

Discussion

If the specified target exists, this function creates an alias record for the target and returns noErr. If the parent directory exists but the target itself does not exist, this function creates an alias record for the target and returns fnfErr. Any other return value indicates that this function did not create an alias record.

Availability
  • Available in OS X v10.2 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSResolveAlias

Returns an FSRef to the single most likely target of an alias record. (Deprecated in OS X v10.8. Use CFURLCreateByResolvingBookmarkData instead.)

OSErr FSResolveAlias (
   const FSRef *fromFile,
   AliasHandle alias,
   FSRef *target,
   Boolean *wasChanged
);
Parameters
fromFile

A pointer to the starting point for a relative search. If you pass NULL in this parameter, FSResolveAlias performs only an absolute search. If you pass a pointer to a valid FSRef in the fromFile parameter, FSResolveAlias 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 should use the function FSMatchAliasBulk.

alias

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

target

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

wasChanged

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

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, FSResolveAlias returns fnfErr. Note that the FSRef in the alias parameter is not valid in this case.

Discussion

The FSResolveAlias function performs a fast search for the target of the alias. If the resolution is successful, FSResolveAlias returns (in the target parameter) the FSRef 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, FSResolveAlias automatically mounts the volume. If the target is on an unmounted ejectable volume, FSResolveAlias asks the user to insert the volume. The FSResolveAlias function exits after it finds one acceptable target.

After it identifies a target, FSResolveAlias compares some key information about the target with the information in the alias record. If the information differs, FSResolveAlias updates the record to match the target.

The FSResolveAlias function displays the standard dialogs 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 dialogs.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSResolveAliasFile

Resolves an alias contained in an alias file. (Deprecated in OS X v10.8. First use CFURLCreateBookmarkDataFromFile, then use CFURLCreateByResolvingBookmarkData.)

OSErr FSResolveAliasFile (
   FSRef *theRef,
   Boolean resolveAliasChains,
   Boolean *targetIsFolder,
   Boolean *wasAliased
);
Parameters
theRef

A pointer to the alias file you plan to open. If the function completes successfully, this FSRef describes to the file or the directory referred to by the alias file.

resolveAliasChains

A Boolean value. Set this parameter to TRUE if you want FSResolveAliasFile 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 pointer to a Boolean value. The FSResolveAliasFile function returns TRUE in this parameter if the FSRef in the parameter theRef points to a directory or a volume; otherwise, FSResolveAliasFile returns FALSE in this parameter.

wasAliased

A pointer to a Boolean value. The FSResolveAliasFile function returns TRUE in this parameter if the FSRef in the parameter theRef points to an alias; otherwise, FSResolveAliasFile returns FALSE in this parameter.

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, FSResolveAliasFile returns fnfErr.

Discussion

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

The FSResolveAliasFile function first checks the catalog file for the file or directory specified in the parameter theRef to determine whether it is an alias and whether it is a file or a directory. If the object is not an alias, FSResolveAliasFile leaves theRef 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, FSResolveAliasFile resolves it, places the target in the parameter theRef, and sets the wasAliased flag to TRUE.

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

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSResolveAliasFileWithMountFlags

Resolves an alias contained in an alias file. (Deprecated in OS X v10.8. First use CFURLCreateBookmarkDataFromFile, then use CFURLCreateByResolvingBookmarkData.)

OSErr FSResolveAliasFileWithMountFlags (
   FSRef *theRef,
   Boolean resolveAliasChains,
   Boolean *targetIsFolder,
   Boolean *wasAliased,
   unsigned long mountFlags
);
Parameters
theRef

A pointer to the alias file you plan to open. If the function completes successfully, this FSRef describes the file or the directory referred to by the alias file.

resolveAliasChains

A Boolean value. Set this parameter to TRUE if you want FSResolveAliasFileWithMountFlags 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 pointer to a Boolean value. The FSResolveAliasFileWithMountFlags function returns TRUE in this parameter if the FSRef in the parameter theRef points to a directory or a volume; otherwise, FSResolveAliasFileWithMountFlags returns FALSE in this parameter.

wasAliased

A pointer to a Boolean value. The FSResolveAliasFileWithMountFlags function returns TRUE in this parameter if the FSRef in the parameter theRef points to an alias; otherwise, FSResolveAliasFileWithMountFlags 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 FSResolveAliasFileWithMountFlags is identical to FSResolveAliasFile with the exception that it provides the mountFlags parameter, allowing callers additional control over how the alias file is resolved.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Related Sample Code
Declared In
Aliases.h

FSResolveAliasWithMountFlags

Returns an FSRef to the target of an alias. (Deprecated in OS X v10.8. Use CFURLCreateByResolvingBookmarkData instead.)

OSErr FSResolveAliasWithMountFlags (
   const FSRef *fromFile,
   AliasHandle inAlias,
   FSRef *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, FSResolveAliasWithMountFlags performs an absolute search. If you pass a pointer to a valid FSRef in the fromFile parameter, FSResolveAliasWithMountFlags 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 should use the function FSMatchAliasBulk.

inAlias

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

target

A pointer to an FSRef structure. On successful return, this FSRef refers to the target of the alias record. This parameter must point to a valid FSRef 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, FSResolveAliasWithMountFlags sets the wasChanged parameter to true. Otherwise, it sets it to false. (FSResolveAliasWithMountFlags 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 FSResolveAliasWithMountFlags is identical to FSResolveAlias with the exception that it provides the mountFlags parameter, allowing callers additional control over how the alias is resolved.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

FSUpdateAlias

Updates an alias record for a specified target. (Deprecated in OS X v10.8. First use CFURLCreateBookmarkData, then use CFURLWriteBookmarkDataToFile.)

OSErr FSUpdateAlias (
   const FSRef *fromFile,
   const FSRef *target,
   AliasHandle alias,
   Boolean *wasChanged
);
Parameters
fromFile

A pointer to the starting point for a relative search. You may pass NULL if you do not need relative search information in the alias record. The two files or directories specified in the fromFile and target parameters must reside on the same volume.

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 that, on output, indicates whether the newly constructed alias record is different from the old one. If the new record is exactly the same as the old one, the value is false. Otherwise, the value is true. Check this parameter to determine whether you need to save an updated record.

Return Value

A result code.

Discussion

This function rebuilds the entire alias record and fills it in as the FSNewAlias function would. The FSUpdateAlias function always creates a complete alias record. When you use FSUpdateAlias to update a minimal alias record, you convert the minimal record to a complete record.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

GetAliasSize

Gets the size of an alias record referenced by a handle. (Deprecated in OS X v10.8. Use CFDataGetLength, passing in the bookmark data.)

Size GetAliasSize (
   AliasHandle alias
);
Parameters
alias

A handle to the alias record from which to get the information.

Return Value

The size of the alias record.

Discussion

The returned size is smaller than the size returned by the function GetHandleSize if any custom data is added. This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

GetAliasSizeFromPtr

Gets the size of an alias record referenced by a pointer. (Deprecated in OS X v10.8. Use CFDataGetLength, passing in the bookmark data.)

Size GetAliasSizeFromPtr (
   const AliasRecord *alias
);
Parameters
alias

A pointer to the alias record from which to get the information.

Return Value

The size of the alias record.

Discussion

This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

GetAliasUserType

Gets the user type for an alias record referenced by a handle. (Deprecated in OS X v10.8. Use CFURLSetTemporaryResourcePropertyForKey to set your own temporary properties on the CFURL object. Then, to embed these properties in the bookmark data, pass the properties in the resourcePropertiesToInclude parameter of CFURLCreateBookmarkData. To prevent conflicts, it’s recommended that you create reverse DNS names for temporary property key strings.)

OSType GetAliasUserType (
   AliasHandle alias
);
Parameters
alias

A handle to the alias record from which to get the user type.

Return Value

The user type associated with the alias.

Discussion

This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

GetAliasUserTypeFromPtr

Gets the user type for the alias record referenced by a pointer. (Deprecated in OS X v10.8. Use CFURLSetTemporaryResourcePropertyForKey to set your own temporary properties on the CFURL object. Then, to embed these properties in the bookmark data, pass the properties in the resourcePropertiesToInclude parameter of CFURLCreateBookmarkData. To prevent conflicts, it’s recommended that you create reverse DNS names for temporary property key strings.)

OSType GetAliasUserTypeFromPtr (
   const AliasRecord *alias
);
Parameters
alias

A pointer to the alias record from which to get the user type.

Return Value

The user type associated with the alias.

Discussion

This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

InvokeAliasFilterUPP

Calls your alias filtering callback function. (Deprecated in OS X v10.8.)

Boolean InvokeAliasFilterUPP (
   CInfoPBPtr cpbPtr,
   Boolean *quitFlag,
   Ptr myDataPtr,
   AliasFilterUPP userUPP
);
Discussion

You should not need to use the function InvokeAliasFilterUPP, as the system calls your alias filtering callback for you.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
  • Not available to 64-bit applications.
Declared In
Aliases.h

NewAliasFilterUPP

Creates a new universal procedure pointer (UPP) to an alias filtering callback function. (Deprecated in OS X v10.8.)

AliasFilterUPP NewAliasFilterUPP (
   AliasFilterProcPtr userRoutine
);
Parameters
userRoutine

A pointer to your alias filtering callback function. For more information, see FSAliasFilterProcPtr.

Return Value

On return, a UPP to the alias filtering callback function.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
  • Not available to 64-bit applications.
Declared In
Aliases.h

SetAliasUserType

Sets the user type for an alias record referenced by a handle. (Deprecated in OS X v10.8. Use CFURLSetTemporaryResourcePropertyForKey to set your own temporary properties on the CFURL object. Then, to embed these properties in the bookmark data, pass the properties in the resourcePropertiesToInclude parameter of CFURLCreateBookmarkData. To prevent conflicts, it’s recommended that you create reverse DNS names for temporary property key strings.)

void SetAliasUserType (
   AliasHandle alias,
   OSType userType
);
Parameters
alias

A handle to the alias record for which to set the user type.

userType

The user type associated with the alias.

Discussion

This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h

SetAliasUserTypeWithPtr

Sets the user type for the alias record referenced by a pointer. (Deprecated in OS X v10.8. Use CFURLSetTemporaryResourcePropertyForKey to set your own temporary properties on the CFURL object. Then, to embed these properties in the bookmark data, pass the properties in the resourcePropertiesToInclude parameter of CFURLCreateBookmarkData. To prevent conflicts, it’s recommended that you create reverse DNS names for temporary property key strings.)

void SetAliasUserTypeWithPtr (
   AliasPtr alias,
   OSType userType
);
Parameters
alias

A pointer to the alias record for which to set the user type.

userType

The user type associated with the alias.

Discussion

This routine is thread safe.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.8.
Declared In
Aliases.h