/* Copyright (C) 1995 Diversified Software Systems, Inc., 18630 Sutter Bl., Morgan Hill, CA 95037 All rights reserved. May be distributed freely WITHOUT MODIFICATION (must include this copyright notice and disclaimer) and WITHOUT WARRANTY OF ANY KIND, express or implied. Diversified Software Systems will accept no responsibility for damages resulting from your use of this EXEC. Use is entirely at your own risk. No support will be provided. Written for OS/2 2.0 and above. Assumes name of directory that contains lockfiles is q:\es\library, and that lockfile format for XYZ.HPP is XYZ.H^P. Will need minor modifications if this is not the case. Instructions: Simplest form is just "WHOHAS", which will give you a list of all modules "checked out" through TLIB, who has them locked, and for how long the lock has existed. Also supports "WHOHAS filename", "WHOHAS pattern", "WHOHAS filename1,filename2,...", "WHOHAS pattern1,pattern2,..." and combinations thereof. "WHOHAS personname" will give you a list of everything that particular person has checked out. SAMPLE OUTPUT: [D:\WORK]whohas whohas ALABAMA.CPP --> PETERJ (since 11/28/95 at 4:18 PM) CALIFORN.HPP --> PETERJ (since 11/28/95 at 3:28 PM) DELAWARE.CPP --> PHILN (since 12/01/95 at 9:58 AM) IDAHO.HPP --> PHILN (since 11/30/95 at 11:06 AM) INDIANA.TXT --> TOMD (since 11/28/95 at 4:51 PM) IOWA.CPP --> PHILN (since 12/01/95 at 9:46 AM) PENNSYLV.CPP --> PHILN (since 11/30/95 at 11:23 AM) TENNESSE.CPP --> PHILN (since 11/30/95 at 11:26 AM) TEXAS.CPP --> PHILN (since 11/30/95 at 11:39 AM) VIRGINIA.CPP --> PHILN (since 11/30/95 at 11:21 AM) WESTVIRG.CPP --> TOME (since 11/27/95 at 1:23 PM) etc. */ ARG lookfor /*trace all;*/ lookForName = 0; haveResult = 0; tempFile = "temp.txt" address CMD "@echo off" specificSearch = 0; secondTempFile = "temp2.txt"; do while (haveResult = 0) if ((lookfor = '') | (lookForName = 1)) then "tlib -q T *,*.* >"tempFile "2>nul" else do "tlib -q T" lookfor ">" tempFile "2>nul" specificSearch = 1; end gotone = 0; do while LINES(tempFile) = 1 in = linein(tempFile) if word(in, 3) = 'checked' then file = word(in, 1) if word(in, 1) = 'User' then do in = linein(tempFile) in = linein(tempFile) who = word(in, 1) file = substr(file, 1, 12) push file; /* these two commands have the effect of */ pull upfile; /* converting the filename to uppercase. */ if (lookfor = who) | (lookfor = '') | (specificSearch = 1) then do i = pos("(you)", in); if (i = 0) then whichUser = substr(who,1,8) else whichUser = "(you) " dotLocation = pos('.', file); if (dotLocation = 0) then do fileName = strip(file, 't'); extension = ' '; end else do fileName = substr(file, 1, dotLocation-1); extension = substr(file, dotLocation+1); end lockExtension = substr(extension,1,1) || '^' || substr(extension,3,1); if substr(lockExtension,1,1) = ' ' then lockExtension = '_' || substr(lockExtension,2); lockExtension = strip(lockExtension, 't'); lockName = ''; command = "dir q:\es\library\" || fileName || "." || '"' || lockExtension || '"'; address CMD command '>' secondTempFile; haveTimeStamp = 0; do while LINES(secondTempFile) = 1 dirLine = linein(secondTempFile); rightLine = pos('-', dirLine); if \ (rightLine = 0) then do haveTimeStamp = 1; sinceDate = word(dirLine, 1); sinceDate = translate(sinceDate, '/', '-'); i = length(sinceDate); if (i = 7) then do sinceDate = ' ' || sinceDate; end sinceTime = word(dirLine, 2); i = length(sinceTime); if (i = 5) then do sinceTime = ' ' || sinceTime; end AMPM = right(sinceTime, 1); justTime = left(sinceTime, length(sinceTime) - 1); if (AMPM = 'a') then do sinceTime = justTime || " AM"; end else do sinceTime = justTime || " PM"; end sinceWhen = sinceDate || " at " || sinceTime; end end push stream(secondTempFile, 'c', 'close'); if (haveTimeStamp = 0) then sinceWhen = "UNKNOWN"; fileAndWho = file || " --> " || whichUser || " (since " || sinceWhen || ")"; say fileAndWho; gotone = 1; haveResult = 1; end end end if (gotone = 0) then do if (specificSearch = 0) then do say "No locks for " lookfor; haveResult = 1; end else do lookForName = 1; specificSearch = 0; push stream(tempFile, 'c', 'close'); pull . end end end