Thread-topic: FSOpenResFile gives eofErr in Jaguar; need to understand
User-agent: Microsoft-Entourage/11.2.1.051004
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/email@hidden
This email sent to email@hidden