PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LockFile and UnLockFile
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
  Syntax: void LockFile( PFILE File );
          void UnLockFile( PFILE File );
 
  See:    SetEditorObject
 
     LockFile increments the lock count for the specified file.
     Unlockfile decrements the lock count. Calls to these functions must
     be strictly paired.
 
     An extension function should lock a file before working on it and
     unlock it before returning. Make sure that a locked file is
     unlocked for all execution paths in the function.
 
     When the lock count is greater than zero, PWB does not expunge the
     file. PWB expunges files when it needs to recover memory to satisfy
     a memory allocation request. Expunging occurs only when available
     memory runs low.
 
     In some situations, an extension creates a permanent or "owned"
     file that should never be expunged. An example is the PWBROWSE
     extension's "<browse>Browser Output" pseudofile. In this case, the
     extension should set the file's NOREMOVE flag when the file is
     created. LockFile and UnLockFile should not be used for NOREMOVE
     files.
     See: SetEditorObject
                                    -♦-