home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / files / flock < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.8 KB  |  37 lines

  1.  
  2.  
  3.           flock options handle [start] [length] [origin]
  4.                This command places a lock on all or part of the file
  5.                specified by handle.  The lock is either advisory or
  6.                mandatory, depending on the mode bits of the file.  The
  7.                lock is placed beginning at relative byte offset start
  8.                for length bytes.  If start or length is omitted or
  9.                empty, zero is assumed.  If length is zero, then the
  10.                lock always extents to end of file, even if the file
  11.                grows.  If origin is "start", then the offset is
  12.                relative to the beginning of the file. If it is
  13.                "current", it is relative to the current access
  14.                position in the file.  If it is "end", then it is
  15.                relative to the end-of-file (a negative is before the
  16.                EOF, positive is after).  If origin is omitted, start
  17.                is assumed.
  18.  
  19.                The following options are recognized:
  20.  
  21.                -read - Place a read lock on the file.  Multiple
  22.                processes may be accessing the file with read-locks.
  23.  
  24.                -write - Place a write lock on the file.  Only one
  25.                process may be accessing a file if there is a write
  26.                lock.
  27.  
  28.                -nowait - If specified, then the process will not block
  29.                if the lock can not be obtained.  With this option, the
  30.                command returns 1 if the lock is obtained and 0 if it
  31.                is not.
  32.  
  33.                See your system's fcntl system call documentation for
  34.                full details of the behavior of file locking.  If
  35.                locking is being done on ranges of a file, it is best
  36.                to use unbuffered file access (see the fcntl command).
  37.