Re: FSCatalogInfo randomness
Re: FSCatalogInfo randomness
- Subject: Re: FSCatalogInfo randomness
- From: email@hidden
- Date: Tue, 30 Oct 2007 17:43:36 +0100
So I just had this problem again. A directory was listed as empty, although
it isn't. There were no others errors except LSCopyItemInfoForURL
returned paramErr (-50). But as I said in my previous post, this error is
returned for almost all files, even when the directory contents is listed
properly.
No error. Just arbitrary results. I find this very strange.
On 10/30/07, email@hidden <email@hidden> wrote:
>
> Thanks all. So far I have not been able to reproduce the problem, but what
> I notice when checking the return status of LSCopyItemInfoForURL is I get
> a paramErr (-50) for *almost* all files and folders in any directory. (The
> other functions return no error). I'm not sure how to interpret that. It's
> obviously not a parameter error since some files return noErr?
>
> On 10/30/07, Uli Kusterer <email@hidden> wrote:
> >
> > On 30.10.2007, at 12:38, email@hidden wrote:
> > > Usually correct,
> > > sometimes not. Also, I have noticed that one particular file is
> > > arbitrarily
> > > flagged as visible/invisible every time I check it. What's wrong here?
> > >
> > > (...)
> > > LSCopyItemInfoForURL((CFURLRef)[NSURL URLWithString:path],
> > > kLSRequestAllFlags, &itemInfo);
> > >
> > > (...)
> > > FSPathMakeRef((unsigned const char *)[path
> > > fileSystemRepresentation],
> > > &possibleInvisibleFile, nil);
> > >
> > > FSGetCatalogInfo(&possibleInvisibleFile, kFSCatInfoFinderInfo,
> > > &catalogInfo, nil, nil, nil);
> >
> > What about checking the return values of these functions? Probably
> > one of them is returning some error that you aren't aware of, and
> > isHidden is then set based on arbitrary data in an un-initialized
> > FSCatalogInfo struct.
> >
> > See <http://www.zathras.de/blog<http://www.zathras.de/blog-carbon-for-the-cocoa-guy->
> > -carbon-for-the-cocoa-guy-<http://www.zathras.de/blog-carbon-for-the-cocoa-guy->
> > oserror.htm> for a description of how to interpret the return values
> > from FSGetCatalogInfo, FSPathMakeRef and LSCopyItemInfoForURL.
> >
> > Cheers,
> > -- M. Uli Kusterer
> > http://www.zathras.de
> >
> >
> >
> >
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden