Important: The information in this document is obsolete and should not be used for new development.
NewAlias
You use theNewAliasfunction 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
fromFilevalue ofNIL. If you wantNewAliasto record relative path information, pass a pointer to a validFSSpecrecord in this parameter. The two files or directories,fromFileandtarget, must reside on the same volume.target- An
FSSpecrecord 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
aliastoNIL.DESCRIPTION
TheNewAliasfunction 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 thealiasparameter.NewAliasalways 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 haveNewAliasstore 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 forNewAliasare
Trap macro Selector _AliasDispatch $0002 RESULT CODE
noErr 0 No error