I'm switching from a Linux server to a Windows 2000 server, which I've
previously mentioned on this list. I've also asked about flock before, but I
have another question.
Currently on the Linux box, I have flock setup like this.....
at the top of the script
use Fcntl qw(:flock); # import the LOCK_EX, LOCK_SH and LOCK_NB
later in the script
open(FILE,">$datafile");
flock(FILE, LOCK_EX);
print FILE "$input\n";
close(FILE);
Notice that I do not use flock(FILE, LOCK_UN); before I close the file. I
don't use it because I was told not to by the server administrator.
Again, that's on Linux. It works correctly, but the books and documentation
I've read always use flock(FILE, LOCK_UN); before closing the file.
Will this cause problems on a Windows 2000 machine?
For those interested, here's more info about flock with Windows.
http://aspn.activestate.com/ASPN/Reference/Products/ActivePerl/lib/Fcntl.htm
l
Thanks!
Brian Shoemaker