🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #642

Re: clock sanity-checking (was: Pascal 2000 Resource Centre)

#642
From: Russell Schulz
Date: Sat, 21 Jun 1997 00:00
41 lines
2461 bytes
Dr John Stockton <jrs@merlyn.demon.co.uk> writes:

> My program, at
> http://www.merlyn.demon.co.uk/programs/clokchek.pas  and  *.exe
> merely checks the present MSDOS date+time against the date+time
> when it was last run, and warns if the change is (adjustably)
> unreasonable.  One can put it in AUTOEXEC.BAT.  It uses one entry
> in C:\ (32 bytes).

hmm.  I have a similar routine, in tPascal, called `sanetime'.  you
pass it the filename (and the maximum tolerance of days since the
last run) on the command-line.  (I don't like extra things on my
c:\, personally).

if it's just after midnight on the same day it was last run (i.e.,
the clock didn't advance the day), it fixes it.  it also checks
for going backwards in time (like the three times I set my clock
to 1995 instead of 1996).

I thought it was part of my uufree package, but I don't know if I
have it up for access anywhere.

usage:

sanetime - do a simple sanity-check on the time

usage: sanetime filename [days]

if the time looks sane (within `days' days (default=2) or so
of the timestamp on the file `filename') it'll update the
timestamp on the file and continue with errorlevel 0.  if
the date is in the past, or way in the future, it will return
with an errorlevel of 2.  any error (such as this one) results
in an errorlevel of 1.  date checking is approximate - the date
and hours are checked, but not the minute

the contents of `filename' may be overwritten - use with a file
that no other procedure or process modifies at all
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c
Technical Details
Message-ID: <19970621.174313.1B4.rnr.w164w_-_@locutus.ofB.ORG>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <33A117FB.4BA2@cabot.co.uk> <$bRnOKA9tYozEwSj@merlyn.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1036bc,30b885c9eedf77d6
X-Google-Attributes: gid1036bc,public
X-Google-Thread: 111659,3e2dddc679758a07
X-Google-Attributes: gid111659,public
From: Russell_Schulz@locutus.ofB.ORG (Russell Schulz)
Subject: Re: clock sanity-checking (was: Pascal 2000 Resource Centre)
Date: 1997/06/21
Message-ID: <19970621.174313.1B4.rnr.w164w_-_@locutus.ofB.ORG>
X-Deja-AN: 252009135
References: <33A117FB.4BA2@cabot.co.uk> <$bRnOKA9tYozEwSj@merlyn.demon.co.uk>
X-Mail-Policy: you may reply to this message.  you may NOT add me to a list.
Followup-To: comp.lang.pascal.borland
X-Spam-Complaint: why does agis.net continue to let Cyberpromo spam me?
Organization: Private System, Edmonton, AB, Canada
Reply-To: Russell_Schulz@locutus.ofB.ORG (Russell Schulz)
Newsgroups: comp.lang.pascal.borland,demon.tech.pc