Jim C.
I reckon that David Smith's SQL solution is pretty good, especially if
How would that work without a SQL type backend that will work with it?
you're using something like PHP or Perl. That'd cater for your locking.
If you don't want to learn both PHP and Perl at the same time, a PHP CGI binary can be made and installed in /usr/local/bin and called from the command line. Others might advise you to go the whole hog and learn C :-) but not me.