Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ig!bionet!agate!ucbvax!decwrl!purdue!iuvax!rutgers!att!pegasus!ech From: ech@pegasus.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: Toolbox Gotchas (LONG) Message-ID: <2785@pegasus.ATT.COM> Date: 14 Apr 89 02:37:14 GMT References: <10050096@accuvax.nwu.edu> Organization: AT&T ISL Middletown NJ USA Lines: 22 From article <10050096@accuvax.nwu.edu>, by jln@accuvax.nwu.edu (John Norstad): > While devoping Disinfectant I ran into a number of "gotchas" that > caused me great grief. I thought it would be nice to tell the > rest of you about these problems, in the hope that you'll be able > to avoid them in your own programs. I've told DTS about most of this stuff. ... > Gotcha #10. Always set the ioNamePtr field in file manager param blocks. Allow me to add my favorite foulup: Gotcha #11: Always set the ioMisc field in calls to PBOpen. Easiest thing here is to clear it. Failure to do so uses random locations in memory as the IO buffer for the file. This one is especially fun because the bomb is (a) guaranteed to hit sometime, and (b) always takes awhile, so you go nuts trying to find a stray pointer which your code never even referenced. Any more true confessions out there? This could be fun... =Ned Horvath=