Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!caen.engin.umich.edu!sol.engin.umich.edu!billkatt From: billkatt@sol.engin.umich.edu (Steve Bollinger) Newsgroups: comp.sys.mac.programmer Subject: Re: DIBadMount Message-ID: <40cd6a85.a590@mag.engin.umich.edu> Date: 11 Jan 89 15:47:00 GMT References: <27435@ucbvax.BERKELEY.EDU> Sender: netnews@caen.engin.umich.edu Reply-To: billkatt@caen.engin.umich.edu (Steve Bollinger) Organization: Computer Aided Engineering Network (CAEN), University of Michigan Lines: 40 Sender: Followup-To: In article <27435@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >I was reading some source code that comes with the THINK C compiler (Also >known as LightSpeed C version 3) and I came across the following in a main >event loop: > [some code deleted] >followed by more stuff, of course. A quick check of Inside Mac Vol. 2, >the Disk Initialization package, says, yes: > >Application programs should watch for disk inserted events in their main >event loops. If the high word of the message of the event is an error, >then pass it to DIBadMount() so it can put up a dialog asking the user >what he wants to do about the bad floppy. > >My question: > >Is this still recommended? It never was recommended. If you read a little farther (bottom of page 395, and top of 396 it says Note: Disk-inserted events during standard file saving and opening are handled by the Standard File Package. You'll call DIBadMount only in other, less common situations (for example, if you program explicitly ejects disks, or if you want to respond to the user's inserting an uninitialized disk when not expected). When your Application received the DiskEvt, the system has aldready tried to mount the volume. If it was successful, great, if not, it will sit in the drive until the SFGet(or Put)File comes up. This is fine because most file operations take place in the SFGet(/Put)File. As a side note, I think that this works a little differently under MultiFinder. +----------------------+----------------------------------------------------+ | Steve Bollinger | Internet: billkatt@caen.engin.umich.edu | | 4297 Sulgrave Dr. +------+---------------------------------------------+ | Swartz Creek, Mi. 48473 | "My employer doesn't take my opinion any | +-----------------------------+ more seriously than you do." | | "You remember the IIe, it +---------------------------------------------+ | was the machine Apple made before they decided people didn't need | | machines with big screens, color, or slots." | | - Harry Anderson (from NBC's Night Court) | +---------------------------------------------------------------------------+