Command: lockf (peu)
 
Syntax: 
  l = lockf( s )       
  
Description: 
   It try's to lock a file .
   The filename is s and extended with '.lck'
   It return 0 if it successed to lock the file
   else wise it return a -1 if the file is in use .
   
Comments: 
   You have to 'lockf( s )' the file BEFORE you open( s ) !
   Donn't forget to 'unlockf( s )' it before you abort or stop
   your program ! Otherwise you get a deadlock .
   
Example: 
   -- test lock and unlock files
   sequence file="klad.tmp"
   if lockf(file)
   then puts(1,"File is in use\n")
   else puts(1,"file is locked\n")
   end if
   unlockf(file)

See Also: 
   unlockf
  

