Nice ++, but you should know that even WITH flock(), you're not absolutely safe. In any interpreted language, ALL function calls not matter how harmless-looking, are interruptable. And "interruptable" means potential race condition when your functions access the same variable (in this case, a file). While with the simple flock() call, your chances are better that you will not end in a race condition (and basically, for messages less than _POSIX_PIPE_BUF in <limits.h> there is almost zero chance of it). But the possibility still exists, so in the interests of full security and functionality, the filesystem should not be depended on as a backbone to a multiuser interfaces. Sadly, that's not an option here and it looks like the %dbhash via Perl's DBM APIs are the best bet (hint, hint,
jptxs).
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.