Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FSOpenResFile gives eofErr in Jaguar; need to understand



If you examine the Jaguar-generated webloc file, does it actually have a resource fork?


On Oct 27, 2005, at 2:27 PM, Jerry Krinock wrote:

I need to read the resource fork of drag-and-dropped .webloc files. Code
works fine in Tiger and Panther, but fails in Jaguar. This feature is not
essential, and I could simply document it as not working in Jaguar, but I've
found that testing and understanding the results in 10.2-10.4 has been a
very valuable quality control requirement. Here is the code:


OSErr err ;
NSString* path = pathFromDragPasteboard ;
FSRef fsRef ;

NSLog(@"path = \"%@\"", path) ;
const unsigned char* pathU = (const unsigned char*)[path UTF8String] ;
err = FSPathMakeRef(pathU, &fsRef, NULL ) ;
NSLog(@"FSPathMakeRef gave fsRef = %x, err = %i", fsRef, err) ;
fileRef = FSOpenResFile ( &fsRef, fsRdPerm );
NSLog(@"FSOpenResFile gave fileRef %i, err = %i", fileRef, err) ;
NSLog(@"ResError = %i", ResError()) ;

In Tiger or Panther I get console output like this:

path = "/Users/jk/test/Yahoo.webloc"
FSPathMakeRef gave fsRef = ff9c8000, err = 3378498
FSOpenResFile gave fileRef 37, err = 0
ResError = 0

and I then go on to extract the 'TEXT' resource with no problem.

But on a Jaguar machine, dropping a copy of the same .webloc file on a copy
of the same app-build I get:


path = "/Users/jk/test/Yahoo.webloc"
FSPathMakeRef gave fsRef = ff9c8000, err = 180069
FSOpenResFile gave fileRef -1 and error = 0
ResError = -39

-39 is documented as "eofErr"; "end of file", I suppose.

Can anyone give me a clue as to what is going on?

Thank you,

Jerry


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/jstiles% 40blizzard.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >FSOpenResFile gives eofErr in Jaguar; need to understand (From: Jerry Krinock <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.