User's Guide

LOCKFIL

Lock or unlock a specified file

Function:

Lock or unlock a specified file. If the file is to be locked, the lock status of the file is returned to the user.

Parameters:

Subcommand -LOCK:
Lock a specified file

INFILE
Input file. The name of the file to be locked.

LOCKFLG
Lock flag. The status of the lock file is returned in the specified TAE string variable.

  LOCKED:   File was already locked
  SUCCESS:  Successfully locked
Subcommand -UNLOCK:
Unlock a specified file

INFILE
Input file. The name of the file to be unlocked. This name specification may include, but does not need to include the suffix of the file to be unlocked.

Examples:

  1. LAS> lockfil-lock infile=filename;suf lockflg=locvar

    If FILENAME;LOCK doesn't already exist in the current working directory, it will be created and a value of "SUCCESS" will be returned in the TAE variable 'LOCVAR'. If FILENAME;LOCK already exists in the current working directory, a value of "LOCKED" will be returned in the TAE variable 'LOCVAR'.

  2. LAS> lockfil-unlock infile=filename;suf

    If FILENAME;LOCK exists in the current working directory, it will be deleted. If FILENAME;LOCK does not exist in the current working directory, no action will be taken.

Description/Algorithm:

The root file name and directory specification from INFILE is extracted and a ";LOCK" suffix is appended to it. LOCKFIL-LOCK will create this file, thereby signifying that INFILE is locked. LOCKFIL-UNLOCK will delete this file, thereby signifying that INFILE is unlocked.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [lockfil-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message displayed immediately preceding this message is the specific error encountered.

  2. [lockfil-vblock] Error returning the TAE parameter block

    An error occurred while sending the TAE parameter block back to the calling procedure PDF. Contact the system administrator.

User Notes:

  1. A lock file is created by LOCKFIL-LOCK even if the specified INFILE does not exist.

  2. LOCKFIL-LOCK will return the status of the lock file in the variable specified by LOCKFLG. This TAE string variable must be declared prior to calling LOCKFIL.