Perl Monk, Perl Meditation | |
PerlMonks |
Locking out a CGI script whilst it runsby heezy (Monk) |
on Feb 18, 2003 at 20:00 UTC ( [id://236374]=perlquestion: print w/replies, xml ) | Need Help?? |
heezy has asked for the wisdom of the Perl Monks concerning the following question: Hi I have a CGI script that trundles through a huge directory of pdf files and retitles them based on values in a mySQL database. As it runs it outputs the old and new titles of the pdf's to the users browser. This takes approx 15 mins to complete At the moment it is possible for more than one person to run the script at a time as all they have to do is point their browser in the right direction. Does anyone have a cunning Perl-ish way of locking out the script so that it can only be run by one person at a time? I thought of using a flag in a config file for the script but this could cause problems if the user clicked stop on their browser and the first invocation of the script never finishes (i.e. never releases the lock) Ideas on this would be a great help thanks all, m
Back to
Seekers of Perl Wisdom
|
|