FSMakeFSSpec
FSMakeFSSpec Convert a file or directory spec into an FSSpec record short vRefNum ; volume reference number long dirID ; parent directory ID
Str255 fileName ; a full or partial pathname You use the FSMakeFSSpec function to convert a conventional file or directory specification into an FSSpec record. vRefNum is the volume reference number, a working directory reference number, a drive number, or 0 for the default volume.
dirID is usually the parent directory ID of the target object. If the
directory is sufficiently specified by either vRefNum or fileName, dirID can be 0. If you explicitly specify dirID (that is, if it is any
value other than 0), and if vRefNum is a working directory reference number, dirID overrides the directory ID included in vRefNum. If the fileName parameter is an empty string, FSMakeFSSpec creates an FSSpec record for a directory specified by either the dirID or fileName is a full or partial pathname. If it is a full pathname,
might identify only the final target, or it might include one or more
parent directory names. If fileName is a partial pathname,
vRefNum, dirID , or both must be valid. Returns: an operating system Error Code. It will be one of: noErr (0) No error
fnfErr (-43) File or directory does not exist (FSSpec is still valid)
Notes: FSMakeFSSpec places the specification in the spec parameter. Call You can pass the input to FSMakeFSSpec in any of the four ways described in File Specification Strategies under the section en titled
If the specified volume is mounted and the specified parent directory
exists, but the target file or directory doesn't exist in that location,
FSMakeFSSpec fills in the record and then returns fnfErr instead of noErr. The record is valid, but it describes a target that doesn't exist. You
can use the record for other operations, such as creating a file with the
In addition to the result codes listed here, FSMakeFSSpec can return a number of different File Manager error codes. If you receive any result