[comp.unix.questions] /usr/spool/lock

SIMSN%NUSDISCS.BITNET@cunyvm.cuny.edu (10/20/89)

 What are LTMP.xxxxx files??

 xxxxx are numbers and I found many of these files in the above
 directory.

 Thanks.

> Sim Ser Ngarn (Jnet%"SIMSN@NUSDISCS")
> National University of Singapore
> Department of Information Systems and Computer Science

mhw@wittsend.lbp.harris.com (Michael H. Warfield (Mike)) (10/22/89)

In article <21202@adm.BRL.MIL> SIMSN%NUSDISCS.BITNET@cunyvm.cuny.edu writes:
> What are LTMP.xxxxx files??

	Those are temporary files that normally would be linked to the final
lock file and then removed.

> xxxxx are numbers and I found many of these files in the above
> directory.

	The "xxxxx" should be the process id of the process creating the
file.  That insures a unique file name with respect to the rest of the
system.

	You seem to have a process somewhere which is failing to properly
create lock files.  The usual technique is to create on of these temporary
files and then link it to the desired lock file name.  The link fails if
the lock already exists and creates the lock if it didn't.  The operation is
"indivisable" as a system call and amounts to the best "test and set"
operation you can come up with for file system operations.  In any case
the process attempting the lock should immediately remove the temp file.
If it failed, it may sleep and try again or it may abort out depending
on the application.  Some systems also support a file create which errors
out if the files already exists but the "link" trick is the one most
universally supported.

Michael H. Warfield  (The Mad Wizard)	| gatech.edu!galbp!wittsend!mhw
  (404)  270-2123 / 270-2098		| mhw@wittsend.LBP.HARRIS.COM
An optimist believes we live in the best of all possible worlds.
A pessimist is sure of it!