◄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 -♦-