home *** CD-ROM | disk | FTP | other *** search
- FileAge / Author: David H. Bennett / Date: 5-3-95 / Version: 1.0
-
- Returns the age of the file in Minutes, Hours, or Days as an
- errorlevel.
-
- Usage:
-
- FILEAGE [[drive:][path]filename[ ...]]
-
- Returns:
-
- Error Levels:
-
- 0-119 - Minutes Old
- 120-166 - Hours Old-118
- 167-253 - Days Old-165
- 254 - More than 88 Days old
- 255 - ERROR
-
- Just another day in network maintenance hell...
-
- I have a customer that has as 286 box hooked to their Netware network
- that operates as an MHS & Internet mail gateway running Connect2 from
- Infinite Technologies and UGATE from The Hunger Project.
-
- Occasionally this machine will lock up (Being the 7 year old 286 that
- it is). The System Supervisor there is aware that she should check
- the Connect2 status screen every morning to make sure the clock in
- the upper right hand corner is still running but occasionally she
- forget's to do this as it is a boring and mundane task. The day she
- forget's to do this, is inevitably the day it will lock up.
-
- My solution was to check the age of a file (Namely
- SYS:MHS\MAIL\PUBLIC\NETMGR.QUE) to help determine if the mail gateway
- is locked up and send a message to the supervisor if it is. I place a
- batch command to check this at several places throughout the system
- including the System Login Script, the batch file I use to run windows
- and several other batch files that workstations have need to execute
- during the day. The general result is that the supervisor will be
- incessantly pestered until they go reset the gateway. Hopefully, this
- will eventually lead the customer to upgrade their mail gateway
- (Probably to a slightly less ancient 386).
-
- So I went out in search of a program that would help me determine the
- age of a file in minutes. I searched Simtel, CICA, Compuserve,
- etc.. I finally got tired of searching! Once again I was forced to
- write another stupid little utility in C (This time I actually used
- C++ features). So I bitched and whined my way through every squiggly
- brace and bitwise operator until I finally hacked out a program that
- did what I needed to do. When all was said and done, I spent about
- half the time writing this little blob as I did searching for an
- existing program that would do this.
-
- The ironic twist is that you are probably searching for a utility to
- do some stupid file age related task _RIGHT_NOW_ and this one
- probably won't suit your needs <grin>. However, maybe you have
- lucked out this time and this will do the trick for your situation.
-
- This is hereby released to the public domain. Don't bother sending
- me any checks for $5. They just clog up my mail box and make it
- harder for my wife fill out the deposit slips. Perhaps you'll write
- something that will help me out someday....
-
- Tech Stuff:
-
- This program was written using some recent Windows/CD based version
- of Borland C++. 5 years ago I would have told you all about how I
- wrote this but I've given up writing C/C++ code for making money,
- basically because the money smells better. C/C++ is a great
- language for poor impoverished computer geeks and large monolithic
- software companies that employ dozens of poor impoverished computer
- geeks to throw at their software projects. But they are still
- better off than those weirdos that program in BASIC.
-
- It uses two C++ classes included in the header file classlib\time.h
- called TTime and TDate. I have absolutely no idea if these are
- standard C++ classes or some sort of thing that Borland invented. It
- _is_ a little better than programming in straight 'C'. Anyway, I
- don't really care if it's standard or not as it does what I need it
- to. I've included the source code which you might get to compile on
- some other compiler if your lucky. (You might win $100,000 in the
- lottery too).
-
- Files on the Disk:
-
- FILEAGE.EXE The Program
- FILEAGE.DOC This DOC file
- FILEAGE.CPP Borland C++ Source Code
- TEST.BAT An MS-DOS Test Batch file for the program.
- CHECKC2.BAT This is the Connect2 checker that I scatter around.
-
- Author:
-
- ---------------------------------------------
- David H. Bennett
- Bennett Software Solutions
- 2608 NW Fawn Drive
- Blue Springs, MO 64015
- ---------------------------------------------
- Phone: 816-228-8788
- Fax: 816-228-3204
- E-Mail: dave@bensoft.com
- CIS: 74635,1671
- ---------------------------------------------