Program that uses file locking -- UNIX : flock « File « Perl






Program that uses file locking -- UNIX

    

$LOCK_EX = 2;
$LOCK_UN = 8;

open(DB, ">>datafile") || die "Can't open: $!\n";

flock(DB, $LOCK_EX) || die ;        
print DB "asdf:asdf\n";
flock(DB, $LOCK_UN) || die;         

   
    
    
    
  








Related examples in the same category

1.The flock Function