Re: Not getting filetype info from FSGetcatlogInfo() function
Re: Not getting filetype info from FSGetcatlogInfo() function
- Subject: Re: Not getting filetype info from FSGetcatlogInfo() function
- From: Matt Gough <email@hidden>
- Date: Fri, 6 Jan 2006 11:36:57 +0000
On 5 Jan 2006, at 07:25, Elango C wrote:
FileInfo *fileInfo = NULL;
enumDir = FSGetCatalogInfoBulk(iterator, 255, &actualObjects,
&containerChanged, kFSCatInfoNone, NULL, newSrcFSRefs, NULL, NULL);
for (i = 0; i < actualObjects; i++)
{
memset(&catalogInfo, 0, sizeof(catalogInfo));
osErr = FSGetCatalogInfo (&newSrcFSRefs[i],
kFSCatInfoGettableInfo, &catalogInfo, &outName, NULL, NULL);
fileInfo = (FileInfo *) catalogInfo.finderInfo;
fileInfo->fileType; // It has to return ICNS or APPL
// based on the file type
}
Your code is a bit inefficient. You should use FSGetCatalogInfoBulk
for what it is intended for, and not just a way to count the items in
a directory. It is silly to then manually do FSGetCatalogInfo on each
file when Bulk could have got all that for you.
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden