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: Doug Knowles <email@hidden>
- Date: Tue, 14 Feb 2006 14:36:03 -0500
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