home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / file_mgt / file_age / fileage.doc < prev    next >
Encoding:
Text File  |  1995-05-03  |  4.5 KB  |  104 lines

  1. FileAge / Author: David H. Bennett / Date: 5-3-95 / Version: 1.0
  2.  
  3.   Returns the age of the file in Minutes, Hours, or Days as an
  4.   errorlevel.
  5.  
  6. Usage: 
  7.  
  8.   FILEAGE [[drive:][path]filename[ ...]]
  9.  
  10. Returns:
  11.  
  12.   Error Levels:
  13.  
  14.       0-119   - Minutes Old
  15.     120-166   - Hours Old-118
  16.     167-253   - Days Old-165
  17.         254   - More than 88 Days old
  18.         255   - ERROR
  19.  
  20. Just another day in network maintenance hell...
  21.  
  22.   I have a customer that has as 286 box hooked to their Netware network
  23.   that operates as an MHS & Internet mail gateway running Connect2 from
  24.   Infinite Technologies and UGATE from The Hunger Project.
  25.  
  26.   Occasionally this machine will lock up (Being the 7 year old 286 that
  27.   it is).  The System Supervisor there is aware that she should check
  28.   the Connect2 status screen every morning to make sure the clock in
  29.   the upper right hand corner is still running but occasionally she 
  30.   forget's to do this as it is a boring and mundane task.  The day she
  31.   forget's to do this, is inevitably the day it will lock up.
  32.  
  33.   My solution was to check the age of a file (Namely 
  34.   SYS:MHS\MAIL\PUBLIC\NETMGR.QUE) to help determine if the mail gateway 
  35.   is locked up and send a message to the supervisor if it is.  I place a 
  36.   batch command to check this at several places throughout the system 
  37.   including the System Login Script,  the batch file I use to run windows 
  38.   and several other batch files that workstations have need to execute 
  39.   during the day.  The general result is that the supervisor will be 
  40.   incessantly pestered until they go reset the gateway.  Hopefully, this 
  41.   will eventually lead the customer to upgrade their mail gateway 
  42.   (Probably to a slightly less ancient 386).
  43.  
  44.   So I went out in search of a program that would help me determine the
  45.   age of a file in minutes.  I searched Simtel, CICA,  Compuserve, 
  46.   etc..  I finally got tired of searching!  Once again I was forced to 
  47.   write another stupid little utility in C (This time I actually used 
  48.   C++ features).  So I bitched and whined my way through every squiggly
  49.   brace and bitwise operator until I finally hacked out a program that
  50.   did what I needed to do.  When all was said and done,  I spent about
  51.   half the time writing this little blob as I did searching for an
  52.   existing program that would do this.
  53.  
  54.   The ironic twist is that you are probably searching for a utility to
  55.   do some stupid file age related task _RIGHT_NOW_ and this one 
  56.   probably won't suit your needs <grin>.  However,  maybe you have
  57.   lucked out this time and this will do the trick for your situation.
  58.  
  59.   This is hereby released to the public domain.  Don't bother sending
  60.   me any checks for $5.  They just clog up my mail box and make it 
  61.   harder for my wife fill out the deposit slips.  Perhaps you'll write
  62.   something that will help me out someday....
  63.  
  64. Tech Stuff:
  65.  
  66.   This program was written using some recent Windows/CD based version 
  67.   of Borland C++.  5 years ago I would have told you all about how I 
  68.   wrote this but I've given up writing C/C++ code for making money,
  69.   basically because the money smells better.  C/C++ is a great 
  70.   language for poor impoverished computer geeks and large monolithic 
  71.   software companies that employ dozens of poor impoverished computer 
  72.   geeks to throw at their software projects.  But they are still 
  73.   better off than those weirdos that program in BASIC.
  74.   
  75.   It uses two C++ classes included in the header file classlib\time.h 
  76.   called TTime and TDate.  I have absolutely no idea if these are 
  77.   standard C++ classes or some sort of thing that Borland invented.  It 
  78.   _is_ a little better than programming in straight 'C'.  Anyway,  I 
  79.   don't really care if it's standard or not as it does what I need it 
  80.   to.  I've included the source code which you might get to compile on 
  81.   some other compiler if your lucky.  (You might win $100,000 in the 
  82.   lottery too).
  83.  
  84. Files on the Disk:
  85.  
  86.   FILEAGE.EXE   The Program
  87.   FILEAGE.DOC   This DOC file
  88.   FILEAGE.CPP   Borland C++ Source Code
  89.   TEST.BAT      An MS-DOS Test Batch file for the program.
  90.   CHECKC2.BAT   This is the Connect2 checker that I scatter around.
  91.  
  92. Author:
  93.  
  94.   ---------------------------------------------
  95.   David H. Bennett
  96.   Bennett Software Solutions
  97.   2608 NW Fawn Drive
  98.   Blue Springs, MO  64015
  99.   ---------------------------------------------
  100.   Phone: 816-228-8788
  101.   Fax: 816-228-3204
  102.   E-Mail: dave@bensoft.com
  103.   CIS: 74635,1671
  104.   ---------------------------------------------