We use a copy of "SLEEP.EXE" that we found several years ago. I believe
it was freeware but I'm not sure. Maybe it was purchased?
It's consumption of cpu is negligible (<1%).
I'm trying to locate the author and ensure that it is "freeware". If so
I will be happy to share it with the List.
It is a stand-alone DOS program with the following features:
SLEEP - Version 4.7
This program "sleeps" until an event occurs. The possible events are: FOR
a
length of time, TILL a certain time, a question ASKed of the user, certain
FILESPECS appear or disappear, the UPS is active, or a SCHEDuled event.
Commands can be combined. Here are some sample uses:
Sleep for 10 sleeps for 10 seconds.
Sleep sched Event.Lst ser 3F8 02 +10 -00 sleeps until the next
event
or until a power outage.
Sleep till 17:30:00 ask 'Do Backup (y/n)' yn +Ready.Flg
sleeps until 5:30pm, until the user answers
the
question, or until the "Ready.Flg" file
exists.
Sleep is DOS, DesqView (uses DV System Memory), OS/2, and Windows aware. 24
hour time format is used. The <Esc> and <F1> to <F12> keys exit at any
time.
The following screens are the complete help information for Sleep. For a
brief
help summary type just "Sleep" by itself. Sleep is freeware.
(Hit any key to continue...)
INDIRECT COMMAND FILE: Sleep "@"<file> Ex: Sleep @Wakeup.Cmd
Sleep will accept an indirect command file. Multiple lines can be used and
command files can be nested. The resulting command line must be under 16K.
FOR syntax: Sleep for [[hh":"]mm":"]ss Example: Sleep for 10
The "hh" and "mm" default to 0 if not specified. The maximum number of
hours
is 9999. Sleep returns an error level of 1 when the time is up.
TILL syntax: Sleep till [[hh":"]mm":"]ss Example: Sleep till
7:23:00
The "hh" and "mm" default to the next hour and minute if not specified.
Thus
you can say: "Sleep till 30:00" to sleep until the next half-hour,
regardless
of the hour. Sleep returns an error level of 2 when it reaches the time.
ASK syntax: Sleep ask '<prompt string>' <legal responses>
Example: Sleep ask 'Are you ready? (Y/n)' yn
The prompt string is delimited by the first character. If empty (just a "
"),
it is not displayed. The <Enter> and <Space> keys return an error level of
200. The legal response keys return error levels of 201, 202, etc., in the
order they are listed. Using a FOR with an ASK yields an "ask with
timeout".
(Hit any key to continue...)
FILESPECS syntax: Sleep ["&"]"+"|"-"<filespec> ...
Example: Sleep &+flag.1 &-flag.2 +flag.3
Sleep takes up to 100 filespecs, with paths and wildcards. Each filespec
must
be preceded by a "+" or "-". Sleep will exit when any of these filespecs is
created (+) or deleted (-). If also prefixed by "&", the conditions for
those
filespecs are AND'ed rather than OR'ed. In the example, Sleep waits until
"flag.1" is created and "flag.2" is deleted, OR until "flag.3" is created.
Sleep returns an error level of 3 when the filespecs are satisfied. Checks
run
once a second, unless slowed by the "/S[x]" switch to x (default = 10)
seconds.
PAR & SER syntax: Sleep par|ser <port adr> <byte> "+"<mask> "-"<mask>
LANtastic Ex: "Sleep ser 3F8 02 +10 -00" waits for AC fail.
LANtastic Ex: "Sleep ser 3F8 02 +80 -10" waits for DC fail or AC OK.
Sleep outputs a byte to the port's control register, then monitors the
port's
status register, looking for the presence (+) or absence (-) of a bit or
bits.
When satisfied, it exits with an error level of 5 or 4. All numbers are
hex.
Port Addresses: LPT1/2/3 = 378/278/3BC COM1/2/3/4 =
3F8/2F8/3E8/2E8
Ctrl Reg Bits: Str/LF/Init/Sel = 01/02/04/08 DTR/RTS = 01/02
Stat Reg Bits: Sel/Err/Ack/Bsy = 10/20/40/80 CTS/DSR/RI/DCD =
10/20/40/80
(Hit any key to continue...)
SCHED syntax: Sleep sched <file> Example: Sleep sched Event.Lst
Sleep returns the error level (normally 100 - 199) of an event when it
occurs.
The events are stored in a file which contains one line per event. Blank
lines
and comments are ignored, except that any trailing comment is displayed as
the
next event to be executed. Anything following a ";" is treated as a
comment.
Each event line has 6 fields, separated by spaces and/or tabs:
<month(s)> <day(s)> <day(s)-of-week> <start time> <duration> <error
level>
Examples: Jan 1-7 Sat,Sun 12:00:00 0 123
Jun-Aug 15,last * 17:30:00 30:00 150
* * Mon-Fri 00:00:00 23:59:59 199
Apr,Oct 10,13-15 Fri-Mon 09:00:00 168:00:00 117
Events are better thought of as "windows". The start time for each window
must
be unique. If a window is small (duration of 0) Sleep must be running at
the
time of the event for it to be executed. If a window is large (maximum of
9999
hours) the event will be executed if Sleep runs anytime during it. Windows
can overlap. An "*" means "all possible selections". A "-" means a range
("from" - "to") of selections. Also, days can be "even", "odd" or "last".
Sleep maintains a tag file, named as the event file but with the extension
".Tag". This file contains the date and time of the last event executed.
(Hit any key to continue...)
Sleep allows the following additional switches:
"/1" Single-spaces the information displayed while sleeping.
"/DV-" Disables DesqView detection.
"/E" Displays the error level which Sleep returns.
Sleep returns the following error levels:
255 = Fatal program error 100-199= SCHED event level 4 = SER port
exit
254 = Command line error 11-22 = <F1-F12> key exit 3 = FILESPEC
exit
253 = File error 10 = <Esc> key exit 2 = TILL time
exit
200+= ASK response level 5 = PAR port exit 1 = FOR time
exit
The cursor keys can be used to modify the time remaining. Note: If
<Ctrl>-Up
and <Ctrl>-Down don't work then use <Ctrl>-Left and <Ctrl>-Right instead.
<Ctrl>-Home = 5 hr more Home = 1 hr more Left = reverse
<Ctrl>-End = 5 hr less End = 1 hr less Right = forward
<Ctrl>-Up = 5 min more Up = 1 min more
<Ctrl>-Down = 5 min less Down = 1 min less 5 or * = stop/run
<Ctrl>-PgUp = 5 sec more PgUp = 1 sec more
<Ctrl>-PgDn = 5 sec less PgDn = 1 sec less
(Hit any key to continue...)
Sleep can also be called to return an error level based on the date or time.
Command: "Year" "Month" "Day" "DoW" "Hour" "Minute"
"Second"
Date/Time: 1980-2107 Jan-Dec 1-31 Sun-Sat 0-23 0-59
0-59
Error Level: 80-207 101-112 101-131 100-106 100-123 100-159
100-159
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|