What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |
The QuickTime Media Layer includes a new function, QTGetAliasInfo , discussed in this section.
Retrieves information from an alias record without actually resolving the record; used to retrieve the name of the target, the names of the target's parent directories, the name of the target's volume, or its zone or server name.
OSErr QTGetAliasInfo(
AliasHandle alias, // input: alias record handle
AliasInfoType index, // input: index specifying requested info
char *outBuf, // output: returned info (C-string)
long bufLen, // input: length of outBuf
long *outLen, // output: length of returned info (includes
trailing nul)
unsigned long flags ); // reserved. Must be 0.
asiZoneName = -3
asiServerName = -2
asiVolumeName = -1
asiAliasName = 0
asiParentName = 1The QTGetAliasInfo function offers an alternative to GetAliasInfo and provides more consistent behavior cross platform. It returns C strings of potentially unlimited length. If you pass in a nil outBuf , or a bufLen that isn't long enough, this routine will return an error, and write the actual needed length to *outLen . So, you could make one call to this API with nil outBuf , then allocate your buffer, and call it again with an appropriate length buffer.
Note that asiZoneName will always return an empty string on Windows. asiServerName will also return an empty string in the usual case of a drive-letter-based path. But sometimes these aliases refer to paths like "\\www.mypage.com\dropboxes\Bob Jones\sample.mov" , instead of a drive-letter based path. In those cases, asiServerName will return "www.mypage.com" , and asiVolumeName will return dropboxes .
What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |