Re: File Path -> FSSpec?
Re: File Path -> FSSpec?
- Subject: Re: File Path -> FSSpec?
- From: Eric Schlegel <email@hidden>
- Date: Thu, 25 Oct 2001 21:06:28 -0700
On Thursday, October 25, 2001, at 08:13 PM, Johnny CN Lee wrote:
Yes. But FSMakeFSSpec doesn't recognize UNIX file path
("/path/filename.ext").
Anyway, I've found a way to do it: Use NSFileManager's
fileAttributesAtPath:traverseLink:, then use NSFileDeviceIdentifier as
vRefNum, and fileSystemFileNumber as dirID, and pass an empty string to
FSMakeFSSpec to create the FSSpec structure.
A better way would be:
FSRef fsRef;
FSSpec fsSpec;
FSPathMakeRef( pathString, &fsRef, NULL );
FSGetCatalogInfo( &fsRef, 0, NULL, NULL, &fsSpec, NULL );
-eric