This article is from the Mac Programming FAQ, by Jon Watte h+@austin.metrowerks.com with numerous contributions by others.
You don't.
OK, I cheated you. There is exactly ONE valid reason to get the full
path of a file (or folder, for that matter) and that is to display its
location to the user in, say, a settings dialog. To actually save the
location of the file you should do this: (assuming the file is in an
FSSpec called theFile - you can use FSSpecs in your program even if you
don't run under System 7; just make your own MyFSMakeFSSpec that fills
in the FSSpec manually if it's not implemented)
*code*
if ( ! aliasManagerAvailable ) { /* System 6 ? */
GetVolumeName ( theFile -> vRefNum , vName ) ;
GetVolumeModDate ( vRefNum , & date ) ;
Save ( vName , date , parID , fileName ) ;
} else {
NewAlias ( NULL , theFile , & theAlias ) ;
Save ( theAlias ) ;
DisposeHandle ( ( Handle ) theAlias ) ;
}
*end*
 
Continue to: