#|
This needs
~/gopher/cgi-bin/.lck
with
chmod go+w
and a READable starting number in
~/gopher/cgi-bin/.counter
with
chmod go+wr
(and
~/gopher/cgi-bin/counter
with
chmod go+rx
)
|#
(defpackage counter)
(in-package counter)

(handler-case
(with-open-file (lock ".lck" :direction :output)
 (let ((number (1+ (with-open-file (in #p".counter"
                                :direction :input)
                    (read in)))))
  (format t "WelCOM to our ~:R lucky visitor~%" number)
  (with-open-file (out #p".counter" :direction :output
                      :if-exists :supersede)
   (prin1 number out))))
(t (e) (format t "I'm upset about ~a~%" e)))

(ext:quit)