I have a C++ library code base that uses Carbon. I need to upgrade it to Cocoa because I'm getting these warnings:
warning: 'FSPathMakeRef' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
warning: 'FSGetCatalogInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
warning: 'FSSetCatalogInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
Here is the place where I'm using these functions:
#ifdef MAC_LIKE
OSErr result;
OSType fileType;
FSCatalogInfo catalogInfo;
FSRef ref;
result = FSPathMakeRef(pathname, &ref, NULL);
BailError(result);
result = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags|kFSCatInfoFinderInfo, &catalogInfo,
NULL, NULL, NULL);
if (result) {
BailError(kNuErrFileStat);
}
/* Build the type and creator */
fileType = 0x70000000;
fileType |= (pRecord->recFileType & 0xFF) << 16;
fileType |= (pRecord->recExtraType & 0xFFFF);
/* Set the type and creator */
((FileInfo *) &catalogInfo.finderInfo)->fileType = fileType;
((FileInfo *) &catalogInfo.finderInfo)->fileCreator = 'pdos';
result = FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catalogInfo);
BailError(result);
#endif
My questions are:
1) How do I change:
result = FSPathMakeRef(pathname, &ref, NULL);
not to use the FSPathMakeRef
function?
2) How do I change:
result = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags|kFSCatInfoFinderInfo, &catalogInfo,
NULL, NULL, NULL);
not to use the FSGetCatalogInfo
function?
3) How do I change:
result = FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catalogInfo);
not to use the FSSetCatalogInfo
function?