Function

FSNewAliasFromPath

Creates a new alias record, given the pathname of the target file or directory.

Declaration

OSStatus 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.

See Also

Creating and Updating Alias Records

FSNewAlias

Creates a new alias record, given a target file or directory.

Deprecated
FSNewAliasUnicode

Creates a new alias record, given the Unicode name and parent directory of the target.

Deprecated
FSNewAliasMinimal

Creates a new minimal alias record, given a target file or directory.

Deprecated
FSNewAliasMinimalUnicode

Creates a minimal alias, given the Unicode name and parent directory of the target.

Deprecated
FSUpdateAlias

Updates an alias record for a specified target.

Deprecated