Re: MDItemCreate very, very, very, slow -- and fails
Re: MDItemCreate very, very, very, slow -- and fails
- Subject: Re: MDItemCreate very, very, very, slow -- and fails
- From: Ryan Britton <email@hidden>
- Date: Tue, 14 Feb 2006 11:46:56 -0800
nil != NULL. Try passing NULL as the allocator instead of nil.
Parameters
allocator
The CFAllocator object to be used to allocate memory for the new
object. Pass NULL or kCFAllocatorDefault to use the current default
allocator.
On Feb 14, 2006, at 11:36 AM, Doug Knowles wrote:
The code:
- (NSDictionary *)loadMetadata
{
NSDictionary *md;
NSString *path = [self valueForKey:@"uniqueIDValue"];
NSLog( @"Fetching metadata for %@", path );
MDItemRef mdi = MDItemCreate( nil, (CFStringRef)path );
if ( mdi != nil ) {
NSArray *attrNames = (NSArray *)MDItemCopyAttributeNames( mdi );
md = (NSDictionary *)MDItemCopyAttributes( mdi, (CFArrayRef)
attrNames );
CFRelease(mdi);
}
else {
md = [NSDictionary dictionary];
}
return md;
}
...and some clarifications:
- The code does work properly sometimes, then starts failing.
- I call this *a lot*; it's not inconceivable that I would invoke this
on hundreds of files, so a leak (most likely on my part) could be
trouble.
Thanks,
Doug K;
What you're describing would be consistent with the framework's MIG
call to mds timing out for some reason. It would be helpful if you
could post a short example snippet that demonstrates this problem. If
you can reproduce it, please file a Radar: <http://
bugreport.apple.com.>.
HTH,
-- Kaelin
_______________________________________________
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
_______________________________________________
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