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: Creating FSRef from vrn, dirID, and name



On Mar 13, 2007, at 12:38:29, Laurence Harris wrote:

Not checking the return code? Brings up an interesting question, though, about the returned error code and the one stored in ioResult. Apple's sample code relies on the returned error code and I think ioResult is more for use with PBMakeFSRefAsync. Someone can correct me if I'm wrong.

That was old code written by someone else. I'll make the correction and use the returned error instead of ioResult.


You can simplify the above a little with the following:

	FSRefParam		parm = { 0 };
	OSErr			err;
	FSRef			parent;
	
	parm.ioVRefNum = vrn;
	parm.ioDirID = dirID;
	parm.newRef = &parent;
	err = PBMakeFSRefSync(&parm);

Are you positive that PBMakeFSRefSync can handle the ioNamePtr of nil? The docs don't mention allowing nil, so I err on the safe side and pass an empty string.


_________________________________________________________
Steve Mills                              Me: 952-401-6255
Senior Software Architect                         MultiAd
email@hidden                       www.multi-ad.com


_______________________________________________ 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: 
 >Creating FSRef from vrn, dirID, and name (From: "Steve Mills" <email@hidden>)
 >Re: Creating FSRef from vrn, dirID, and name (From: "Steve Mills" <email@hidden>)
 >Re: Creating FSRef from vrn, dirID, and name (From: Laurence Harris <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.