Hello,
Thank you all for your wisdom. I do appreciate the help & tips:
a, just to clarify, all the files were using the same
$SEMAPHORE file, so any instance of $tempfile getting written to,
$tempfile was locked. I double checked the locks as well,
by placing the sleep method KM had discussed. The lock was
working when I had checked. (Using the names "$tempfile" and
"$file" were actually just examples, in the code the real file
names are placed instead.)
I dunno, I've gone over this a bizillion times and double
checked everywhere, and it only happens once in a while where
the file gets wiped. I really like KM's method because it
does make sense, and that's probably the first time flock()
actually makes sense to me. I would guess it's better than
when I first began using just flock(FILE,2);
I'll keep plunking away at it, and hopefully I'll get something
that will work. Also thanks for the tip to debug "rename" I'll
add that right away.
AgentM Thank you for letting me know about the module
File::CounterFile I went and took a look, it looks interesting
enough, but it says under Bugs that it uses the flock(2);
method. This was something I was trying to avoid. What are your
feeling on that?
Well Thanks again, I do appreciate the help :-)
PS.. Thanks turnstep that search was great!!
|