Hi, I am in Mac.
How to get NSString (Unix style path) from FSSpec
Regards, Dhana.
Hi, I am in Mac.
How to get NSString (Unix style path) from FSSpec
Regards, Dhana.
I think below code will work fine..
If wrong please modify..
char * UnixPathFromFSSpec(FSSpec *sfile)
{
char unixPath[2048];
unixPath[0] = '\0';
FSRef ref;
if(FSpMakeFSRef(sfile, &ref) == noErr )
{
FSRefMakePath(&ref, unixPath, sizeof(unixPath));
}
return unixPath;
}
CFURLCopyFileSystemPath
function or the -[NSURL path]
method.Don't forget to release the CFURL, since you Created it. The same goes for the path, if you Copied it.