• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: isFilePackageAtPath:@"/dev" error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isFilePackageAtPath:@"/dev" error


  • Subject: Re: isFilePackageAtPath:@"/dev" error
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 25 Jun 2002 19:33:12 -0400

LSCopyItemInfoForURL() is not a part of Carbon. It is a part of LaunchServices which is a part of the Core -- actually, a part of Application Services. The Foundation and Cocoa are implemented against those APIs and, as such, a call through the Foundation may generate a Core error if something goes horribly wrong. Whether it uses LSCopyItemInfoForURL() or LSCopyItemInfoForRef() is irrelevant, but-- likely-- it is using the former because it is easier to turn a path into an URL than a path into a file ref.

However, this behavior seems wrong in the 'this is a bug' category. File a report against bugreport.apple.com with a minimal code example.

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

// insert code here...
NSLog(@"Hello, World! %d", [[NSWorkspace sharedWorkspace] isFilePackageAtPath:@"/dev"]);
[pool release];
return 0;
}

The above does fail in the manner described.

As an alternative, are you looking for a particular bundle type? If so, then look for the extension prior to asking for 'isFilePackageAtPath:' as it'll be a boatload faster. As well, you might want to consider pruning certain trees of directories, if appropriate.

b.bum

On Tuesday, June 25, 2002, at 06:45 PM, email@hidden wrote:

every time I use the API on the @"/dev" folder
[[NSWorkspace sharedWorkspace] isFilePackageAtPath:@"/dev"];

I get this error on the console.log (or in PB Tool Tab)
MyApp[2173] LSCopyItemInfoForURL() returned 2767760 for path (null).
I know that is a Carbon API, but I don't understand what it's doing here.
At least, it should be LSCopyItemInfoForRef... I suppose.

The folder @"/dev" is a MacOS X hidden folder placed on the root of the boot
disk. And the path is not null, I verified with the API
[[NSFileManager defaultManager] fileExistsAtPath:@"/dev"];
and that item exists. I know that's a folder and not a filePackage, but I'
m
iterating through the disk root, so I have to check this "on the fly".

My application doesn't quit, and it continues to work well the same.
What is that error? How could I fix that?
Please, may someone let me understand?
Thank you.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: ADC TV & RE: Tech Support Incidents available
  • Next by Date: Re: Need Help w/ NSWindow and NSMovieView...
  • Previous by thread: Re: isFilePackageAtPath:@"/dev" error
  • Next by thread: Searching for "frontmost" NSView of a certain type?
  • Index(es):
    • Date
    • Thread