Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!udel!eplrx7!leipold From: leipold@eplrx7.uucp (Walt Leipold) Newsgroups: comp.sys.mac.programmer Subject: Shutdown Manager Summary: How can you tell a Shutdown from a Restart? Message-ID: <1990Jan16.193431.28545@eplrx7.uucp> Date: 16 Jan 90 19:34:31 GMT Sender: usenet@udel.EDU Reply-To: leipold@eplrx7.UUCP (Walt Leipold) Organization: E.I.DuPont de Nemours & Co. Lines: 31 We've developed a product called the 'MacbRISC', a Unix computer on a NuBus card (features: 40/50/60-MHz Clipper RISC processor, 8/16/32 Mbytes RAM, built-in Ethernet, 2 SCSI controllers, 2 serial ports, MMU-controlled mapping of RAM to NuBus, etc). Although the MacbRISC is a completely independent co-computer, it *does* share the Mac's power supply. Unfortunately, the Unix filesystem doesn't like to be unexpectedly powered down, so we want to discourage the MacbRISC user from shutting down his Mac (and thus his MacbRISC board) while the MacbRISC's Unix is running. To do that, I've written an INIT to install a shutdown task which checks on the Unix status; if Unix is up, a dialog box will ask the user if he'd rather do a Restart instead of a Shutdown. The problem: Since my shutdown task must use dialogs and other resources from its INIT file in the System folder, I've installed it to run before sdUnMount time. However, IM V doesn't tell me how a shutdown task can determine whether it was invoked via a "Shutdown" or a "Restart" from Finder/Multifinder (right now, the stupid dialog appears for every Restart as well as every Shutdown). I suppose I can patch the Shutdown trap and work my magic before any Shutdown tasks are run, but the mere existence of the Shutdown Manager makes me reluctant to reinvent the (possibly incompatible) wheel. So, does anybody out there have any idea how my shutdown task can determine what kind of shutdown/restart it was called during? ----- "As long as you've lit one candle, Walt Leipold you're allowed to curse the darkness." (leipolw%esvax@dupont.com) ---- -- The UUCP Mailer