> I have some records which are locked. The Item ID is same. Can I get the
> database filename to which the records belong?

The locking tables use device and inode numbers and have no reference to the
file name.

Two easy solutions...

1. Run ACCOUNT.FILE.STATS and look up the inode number in the resultant
STAT.FILE. This is easy but is going to take a while!

2. Write a simple program to build your own register of inode numbers. You
can do this with a loop based on the following

  OPEN 'VOC' TO VOC.F ELSE STOP 'Cannot open VOC'
  SELECT VOC.F TO 1
  CT = 0
  LOOP
      READNEXT ID FROM 1 ELSE EXIT
      READ VOC.REC FROM VOC.F, ID THEN
         TYPE = VOC.REC[1,1]
         IF TYPE = 'F' OR TYPE = 'Q' THEN
            OPEN ID TO DATA.F THEN
               STATUS VAR FROM DATA.F THEN
                  INODE = VAR<10>
                  DEVICE = VAR<11>
                  ...Save this data somewhere...
                  CT += 1
                  IF REM(CT, 100) = 0 THEN DISPLAY CHAR(13):CT:' files
processed':
               END
            END
         END
      END
   REPEAT

   DISPLAY CHAR(13):CT:' files processed'
END

I have used this many times to build a file, keyed by inode that contains
the file name and other useful information. It is very fast.

Beware that resizing a file will usually change its inode so you need to run
this program again.


Martin Phillips
Ladybridge Systems
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB
+44-(0)1604-709200
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to