sub lockfile
{
 my ($id) = shift; 

	# Get the paramter for which type of lock we want:
	# 1 for a shared lock (read) or 2 for an exclusive lock (write).
	# If the operating system is non-windows, perform the file locking, otherwise do nothing.

 unless(lc($^O) eq "mswin32"){flock (FILE,$id) || die "$!";}
}
1;