LockCheck 1.2 - November 18, 1999
==============================

Included Files:

LockChk.CPP - C++ Source Code
LockChk.Exe - Win32 Executable
LockChk2.Exe - OS/2 Executable
LOCKCHKD.COM - DOS Executable



Syntax:

LockChk <filename>



Useage:

LockCheck is a simple utility which checks to see if a specified file or 
set of files is in use by another process.  Returns an ERRORLEVEL 1 if 
any of the selected files are in use and a 0 if not as well as displaying
a plain text message to the screen.



Example:

@ECHO OFF

:TOP
LockChk *.DBF
IF ERRORLEVEL 1 GOTO LOCKED
GOTO PROCESS

:PROCESS
ARCHIVE 01/01/1999
GOTO END

:LOCKED
ECHO Sorry, someone's in the system.
GOTO END

:END



Installation:

Just copy the appropriate LockCheck executable to somewhere in your PATH 
(ie, C:\DOS, C:\Windows, C:\OS2, etc.).



New Features Since 1.0:

+ Now accepts wildcards.  (yeah!)

New features since 1.1:

This is primarily a bugfix release but there are a couple of new features.
First the bugs that were fixed:

+ Path+Filename bug: LockCheck wasn't honoring the full pathname for the 
  filespec.  The end result was that if you were not in the directory where 
  the files you were checking were located, it would report that the file(s) 
  did not exist or were locked. -- FIXED

+ Resource allocation bug:  Doh! I forgot to free the file handle after
  attempting a lock.  Thus you could run out of file handles before 
  LockCheck completed processing all the specified files.  Again, LockCheck 
  would just report that the files didn't exist or were locked. -- FIXED

And the new features:

+ "Intelligent" error processing: While chasing down the aformentioned bugs
  I quickly decided that a simple PASS/FAIL message didn't cut it since
  more than one kind of error condition could result in a lock failure.
  Now LockCheck will identify the file that it failed on and why it was
  unable to obtain a lock.

+ File list display: You now see the list of files as LockCheck processes
  them.



Distribution:

I am releasing LockCheck and its accompanying C++ source code into the 
public domain and you may distribute it freely.  You may also freely use 
the source code in any way that you see fit.



Contacting the author:

If you have any questions, comments, suggestions, etc. I can be reached via
Internet e-mail at sysop@coderite.com



History:

1.2 - November 18, 1999
Fixed bugs, added "intelligent" error processing and display to screen list
of files as they are processed

1.1 (Not pubicly released) - November 16, 1999
Now accepts wildcards

1.0 - August 9, 1999
Initial release



Why I built LockCheck (for the morbidly curious):

I've needed a utility like this for years, but until recently I'd never
tried my hand at programming.  There's nothing quite like getting your tail
in a sling to stir up the creative juices however....  Anyway, I thought
that perhaps if you understood the application that LockCheck was built for
it would give you a better idea of where it could be useful.

LockCheck was written to compensate for a major shortcoming in another
piece of software.  My company has an FTP server set up to use a directory 
on the network.  A batch process that I set up periodically checks the 
directory for files and then performs a number of actions on anything it 
finds there.  Since the files we recieve from our clients routines run 5mb - 
45mb in size, the likelihood that a file might still be in transit when the 
batch process is scheduled to run can be quite high depending on the time of 
day.  Most Win32 software that I've used will check to see whether a file is 
in use by another program before attempting to use or modify it, but not a 
particularly expensive command line public key encryption software package 
that we bought which is specifically designed to be used with Win32 command 
line scripts and batch files in a networked environment.  This particular 
product would immediately start trying to decrypt files and if it hit one 
that was in the process of being transmitted it would hang and lock up the 
process as well as halting the transmission.  LockCheck was specifically 
written to work around this limitation.