Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Please help w/ PBSetCatInfo Message-ID: <9466@hoptoad.uucp> Date: 3 Jan 90 03:19:55 GMT References: <30340@shemp.CS.UCLA.EDU> <37560@apple.Apple.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 31 >In article <30340@shemp.CS.UCLA.EDU> tj@oahu.cs.ucla.edu (Tom Johnson) writes: >> error=PBGetCatInfo(&myInfoRec,false); >> if (error != noErr) SysBeep(10); >> [flags set, etc.] >> error=PBSetCatInfo(&myInfoRec,false); >> if (error != noErr) Debugger(); >> >>When I run this code, no error is detected on the PBSetCatInfo call and >>the CInfoPBRec appears to be correctly filled in, but PBSetCatInfo >>returns error=FFD5 a fnfError (file not found). Does anybody have >>any idea why? This has been driving me crazy for hours!! In article <37560@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: >I think that what is happening is that your ioDirID field is being changed from >MyCurID on the PBGetCatInfo call. Then, when you try the PBSetCatInfo call, >you are using a DirID different from the original one. Yes. PBGetCatInfo changes the dirID it returns, apparently to the file ID. (Yet another place where this pointless feature is a pain in the ass.) It is necessary to save the dirID before calling PBGetCatInfo, then to reset the ioDirID field to this saved value before calling PBSetCatInfo. And of course, this is completely undocumented, unless you count the mysterious two-headed arrow before ioDirID in the description of the PBGetCatInfo routine. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "When errors are found in old research, the relevant theories are re-examined. When facts contradict theory, theory gets dumped. Is that why the NLP people are unwilling to research their facts?" -- Jerry Hollombe on sci.psychology