in reply to lock files vs. non-predictable file names

Firstly, I would question why you are using a lock file at all, as it wouldn't seem to matter to me if this runs a few times. At worst, you're getting a double page -- but that may not be such a bad thing.

Secondly, one way to make sure that your script created the lock file is to create a directory in temp, protected by your username (chmod 700), and create your lock file inside. When your script is finished, it can leave the dir, or delete it.

Other than that, the script looks fine to me. For only speaking perl for 5 days, it's quite good. You may want to look into the module Net::Ping on CPAN.

Cheers,
Shendal
  • Comment on Re: lock files vs. non-predictable file names

Replies are listed 'Best First'.
RE: Re: lock files vs. non-predictable file names
by RuphSkunk (Acolyte) on Aug 26, 2000 at 01:52 UTC
    I thought about that too, why I was continuing to use the lock file that is. It was in the script I was trying to improve. I had asked someone familiar with the history of that script why it was being used, and they said somthing to the effect that at one time something prevented mailx from completing and reexecution of the script just caused more mailx instances and more script instances. But thinking about it as I type this, the $nlfile should prevent that problem from reoccuring, if it still exists. I will dig into Net::Ping, so many modules-so little time.=) Thanks for looking.