home *** CD-ROM | disk | FTP | other *** search
- M U R U T I L
- Harry Murphy's Utilities
-
- 22 November 1988 Edition
- (MURUTIL4)
-
- This is a collection of routines and files which I find useful on
- my COMPAQ Desk Pro Computer. They all assume that you are running under
- MSDOS Version 2.0, or later, on an IBM PC/XT/AT computer or an equi-
- valent "clone" with an 8086 or 8088 or equivalent processor.
-
- This edition contains three new "pipeline" utilities, DETAB, PIPE
- and TRIM. DETAB expands tab codes by inserting blanks, assuming tabs at
- column 9, 17, 25, 33 and so forth. PIPE merely copies its input to its
- output. TRIM deletes trailing blanks.
-
- In this edition, WHERE now searches for files without an extension
- as if they had a wildcard extension. That is, "WHERE myfile" is proces-
- sed as if it were "WHERE myfile.*", but "WHERE myfile." is processed
- without change.
-
- In this edition, UPDATE is substantially faster than in previous
- versions because it copies the files itself, rather than invoking the
- COPY utility. UPDATE's verification is now a true byte-by-byte verifi-
- cation; earlier versions relied on COPY's /V option.
-
- ------------------------------------
-
- This edition of MURUTIL contains the following utilities:
-
-
- ALERT This Turbo Pascal program generates a series of five warbling
- alert tones once a minute until a total of fifteen have passed. This
- can be useful when you include ALERT in a batch file to tell you that a
- long-running program has finished.
-
- ALMANAC This Turbo Pascal program gets the current DOS date/time and
- displays almanac information as in the following example:
-
- 14:10h MST, Thursday, 18 February 1988
- This is day 49 of the year 1988.
- Sunrise today is at 6:49h MST.
- Sunset today is at 17:52h MST.
- Length of day: 11:02h.
-
- You may want to include ALMANAC in your AUTOEXEC.BAT file. (See
- the AUTOEXEC.BAT example.)
-
- CAPSLOCK Some programs tinker with the CapsLock bit to force the user
- into an upper-case or a lower-case mode without telling him nor
- re-setting it when they exit. Changing this bit may not affect the LED
- on the keyboard so the user may find himself typing in lower case, even
- though the CapsLock light is on -- or vice versa. CAPSLOCK is a small
- assembly program which simply toggles the CapsLock bit. If you find
- yourself in a reversed CapsLock mode, simply run CAPSLOCK and that
- should fix it.
-
- DATETIME This Turbo Pascal program gets the current date and time from
- the keyboard, using an unambiguous date format, and sets the DOS date
- and time accordingly. You may want to include DATETIME in your
- AUTOEXEC.BAT file. (See the AUTOEXEC.BAT example.)
-
- Acceptable date formats are: "04-JUN-86", "4JUN86", "4 JUN 1986"
- and so forth.
-
- Acceptable time formats are: "9:55:12", "9:55", "9.55", "9;55" and
- so forth.
-
- DATTIM This Turbo Pascal program displays the current date and time
- on the screen in the following format: "12:03h, Saturday, 10 May 1986".
-
- DETAB This assembly language program is a filter, or pipeline, rou-
- tine which converts tab codes to spaces while copying the input file to
- the output file and filtering out the FFH byte and all control bytes.
- Each carriage-return is followed by a line-feed code. Trailing blanks
- are deleted. An all-blank line is written simply as a CR/LF combination.
- Tab stops are assumed every 8 spaces at column 9, 17, 25, 33 etc.
-
- DETAB Examples:
-
- DETAB <INPUT.FIL >OUTPUT.FIL
- DETAB <AFILE.TXT | SORT >AFILE.SRT
- DIR *.PAS | DETAB | SORT >DIR.LIS
-
- DIFF This Turbo Pascal program compares two text files and
- displays their differences (if any). "Syntax: DIFF afile.ext bfile.ext
- [diff.lis]". See DIFF.DOC for more detailed information.
-
- DUMP This Turbo Pascal program displays the contents of a file in
- hex and ASCII format.
-
- FULLDIR This Turbo Pascal program generates full directories. When
- run with no parameters, FULLDIR generates a directory of all files in
- the default directory and all subdirectories. When run with a specified
- directory, FULLDIR generates a directory of all files in that directory
- and all subdirectories. For example, if your default drive is C:, then
- running "FULLDIR C:\" will generate a directory of all the files on your
- default drive. The output from FULLDIR can be redirected. For example,
- "FULLDIR C:\ > ALLFILES.LIS" will write the directory to ALLFILES.LIS.
-
- LOCKPS This small assembly program toggles the Print Screen in
- Progress bit to lock/unlock the PrtSc key. On my computer, the PrtSc
- key is the "upper case" of an extra asterisk key. If I'm holding the
- shift key down when I hit the asterisk key, I don't get an asterisk, I
- get an unwanted screen dump. LOCKPS prevents this by setting a bit
- which makes MSDOS think that a screen dump is already under way. A
- second run of LOCKPS clears the bit so that the key can be used
- normally.
-
- LOOK This Turbo Pascal program allows one to look at an ASCII file
- and to scroll forwards and backwards through it without altering the
- file. Although many screen editors can be used for this purpose, there
- is always a chance that you might inadvertently delete or add something
- while doing so. LOOK allows you to look without this danger.
-
- MAXIM This assembly language program displays a randomly-selected
- quotation from a library of over 500 one-line quotations. You may want
- to include MAXIM in your AUTOEXEC.BAT file. (See the AUTOEXEC.BAT
- example.)
-
- MRKTIM This program marks the current time, in seconds since
- midnight, for subsequent use by the RUNTIM program. The information is
- stored in the Intra-Application Communications Area, memory locations
- 0:04FA through 0:04FF.
-
- PIPE This assembly language program is a pipeline routine which
- merely copies its input file to its output file, using an 8192 byte I/O
- buffer. Its primary use is to copy a file back to itself after it has
- been processed by another pipeline routine. (See the second example.)
-
- PIPE Examples:
-
- PIPE <INPUT.FIL >OUTPUT.FIL
- SORT <DATA.FIL | PIPE >DATA.FIL
-
- RUNTIM This Turbo Pascal program displays the run time of an event
- marked by a prior call to MRKTIM. The information is stored in the
- Intra-Application Communications Area, memory locations 0:04FA through
- 0:04FF.
-
- SNAP This assembly language routine takes a "snapshot" of the
- current display screen and writes it to the file, SNAP.001. If
- SNAP.001 already exists, the file is written to SNAP.002 and so forth.
-
- TRIM This assembly language program is a pipeline routine which
- copies its input file to its output file while filtering out the FFH
- byte and all control bytes, except for tabs. Each carriage-return is
- followed by a line-feed code. All trailing blanks are deleted. An all-
- blank line is written simply as a CR/LF combination.
-
- TRIM Examples:
-
- TRIM <INPUT.FIL >OUTPUT.FIL
- TRIM <ADDR.LIS | SORT >ADDR.LIS
- DIR *.FOR | TRIM >DIR.LIS
-
- UPDATE This Turbo Pascal utility compares the files in a source
- directory (or device) with files in a target directory (or device) and
- copies those files in the source directory which aren't in the target
- directory or which are more recent than the files in the target
- directory. The copies are performed in alphabetical order. For
- example, "UPDATE *.* A:*.*" will copy files from the default directory
- to the floppy drive, A:. There are two mutually exclusive options to
- UPDATE, "/S" and "/V". These options, if used, MUST be the third
- parameter to UPDATE. The "/S" option shows which files would be copied,
- but does not do the copying. The "/V" option performs a byte-by-byte
- verification of each file after it is copied. If you hit any key while
- UPDATE is running, UPDATE will pause and allow you to continue or to
- abort the update process.
-
- UPDATE Examples:
-
- UPDATE *.FOR A: Updates all files with the extension
- ".FOR" from the default directory to
- drive A:.
-
- UPDATE A:*.ASM *.* /S Shows which .ASM files would be copied
- from drive A: to the default directory.
-
- UPDATE C:\WORK\*.* A:*.* /V Updates all files from C:\WORK\ to
- drive A: with verification.
-
- WHERE This Turbo Pascal program searches the entire default drive
- for all occurrences of a file, including hidden and system files. Wild-
- card specifications are permitted. For example, "WHERE *.FOR" will find
- all files ending in the extension of FOR. Similarly, "WHERE *.P??" will
- find all files ending in an extension starting with "P". The output
- from WHERE can be redirected. For example, "WHERE TP*.* > TP.LIS" will
- write the file list to TP.LIS.
-
- ------------------------------------
-
- Note that, with the exception of my MAXIM program, I have included
- the source program for each of these utilities. My policy is not to
- use anyone's program until I have a copy of the source code which I can
- examine, compile and link myself. In these days in which sociopathic
- hackers are writing programs infested with trap doors, Trojan horses and
- viruses, my policy makes more sense than ever and I urge you to adopt it
- too. If you are uncertain about using MAXIM, write or call me for the
- proper date/time and number of bytes for MAXIM executable file.
-
- I wrote programs ALERT, ALMANAC, CAPSLOCK, DATETIME, DATTIM, DETAB,
- DIFF, DUMP, FULLDIR, LOCKPS, LOOK, MAXIM, MRKTIM, PIPE, RUNTIM, SNAP,
- TRIM, UPDATE and WHERE and I hereby make them available for free, non-
- commercial, distribution and use.
-
- Although I have taken great care in writing my programs, I make no
- warranty as to their suitability nor usefulness for any application, use
- or purpose and I hereby specifically disclaim any responsibility for any
- loss or damage resulting from the use of these programs, which are
- herewith furnished for you to use at your own risk, as you see fit.
-
-
- Harry M. Murphy, Consultant
- 3912 Hilton Avenue, NE
- Albuquerque, NM 87110
- Tel: (505) 881-0519
- 22 November 1988.
-