Paul wrote:
> 
> One option is to rename the logfile temporarily. Have the script call
> it something like LogTemp$$ or something ($$ is the PID of the current
> job). Then it doesn't *exist* in it's previous name. Move it back to
> the original filename when you're done.

        If you have admin privs on the system in question, check out the
File::Flock module, which should handle logfile stuff for you
automatically.

        # perl -MCPAN -e shell
        cpan> install File::Flock
        # perldoc File::Flock

        flock() is also somewhat system-dependent...  Here's another link to a
different module which might also be interesting:

http://ls6-www.cs.uni-dortmund.de/cgi-bin/SFgate?language=English&verbose=1&listenv=DL&application=cpan&convert=CPAN&converthl=&refinequery=application%3dcpan%26convert%3dCPAN%26database%3dwait%252FDB%252Fcpan%26detex%3d1%26formextern%3dCPAN%26multiple%3d1%26range%3d1%26verbose%3d1%26name%3d%26synopsis%3d%26text%3dflock%26author%3d%26tie%3dor%26_lines%3dwhole%2bdocument%26maxhits%3d40%26language%3dEnglish&formintern=&formextern=CPAN&transquery=flock&_lines=&multiple=0&descriptor=wait%2fDB%2fcpan%7c44%7c8401%7cLockFile::Simple%20-%20simple%20file%20locking%20scheme%20%7cCPAN%7cwait%7c%2fservices%2fwww-db%2fWAIT%2fDB%2fcpan%7c3691

        (or just look for docs on LockFile::Simple ;)

Cheers,
- Matt

Reply via email to