home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 20125 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.2 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!agate!ucbvax!mtxinu!taniwha!paul
  2. From: paul@taniwha.UUCP (Paul Campbell)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Detecting reboot or startup
  5. Message-ID: <1354@taniwha.UUCP>
  6. Date: 19 Dec 92 03:54:21 GMT
  7. References: <cmcclary-151292113831@mcclary-mac.ucs.indiana.edu>
  8. Organization: Taniwha Systems Design
  9. Lines: 20
  10.  
  11. In article <cmcclary-151292113831@mcclary-mac.ucs.indiana.edu> cmcclary@ucs.indiana.edu (Charles McClary) writes:
  12. >What is the best/preferred method for an application to detect if the
  13. >system has been rebooted or restarted since it (the application) last ran.
  14.  
  15. Assuming you saved the time your app last ran in a file and resource and
  16. then read it back again into 'last_time_ran' then try:
  17.  
  18.     unsigned long    last_time_ran, now;
  19.  
  20.     ReadDateTime(&now);
  21.     if ((now - (TickCount()/CLOCKS_PER_SEC)) > last_time_ran) {
  22.         // - we rebooted since last time we ran
  23.     }
  24.  
  25.     Paul
  26. -- 
  27. Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P
  28. Use up your Quayle jokes now while they're still good "Quayle for Pres. in '94"
  29.      Q: Why is Marilyn Quayle like Marion Barry?
  30.      A: They both suck a little dope.
  31.