Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 4 - Alias Manager / Alias Manager Reference
Alias Manager Routines / Creating and Updating Alias Records


NewAlias

You use the NewAlias function to create a complete alias record.

FUNCTION NewAlias (fromFile: FSSpecPtr; target: FSSpec;
                   VAR alias: AliasHandle): OSErr;
fromFile
The starting point for a relative path, to be used later in a relative search. If you do not need relative path information in the record, pass a fromFile value of NIL. If you want NewAlias to record relative path information, pass a pointer to a valid FSSpec record in this parameter. The two files or directories, fromFile and target, must reside on the same volume.
target
An FSSpec record for the target of the alias record.
alias
A handle to the newly created alias record. If the function fails to create an alias record, it sets alias to NIL.
DESCRIPTION
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 path information as well by supplying a starting point for a relative path (see "Relative Searches" on page 4-5 for a description of relative paths).

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for NewAlias are
Trap macroSelector
_AliasDispatch$0002

RESULT CODE
noErr0No error

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996