home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / vmsnet / misc / 765 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  2.0 KB

  1. Path: sparky!uunet!stanford.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a1155
  2. From: Sanyee_Tang@mindlink.bc.ca (Sanyee Tang)
  3. Newsgroups: vmsnet.misc
  4. Subject: RMS File Lock Questions
  5. Message-ID: <14724@mindlink.bc.ca>
  6. Date: 30 Aug 92 09:36:48 GMT
  7. Organization: MIND LINK! - British Columbia, Canada
  8. Distribution: world
  9. Lines: 46
  10.  
  11.     I am writing a utility in C to find all RMS locks on a specified file.
  12. The scheme is:
  13.  
  14. (a) Call SYS$PARSE and SYS$SEARCH to find the 6-byte file ID (field NAM$W_FID)
  15.     and device name (field NAM$T_DVI).  The file could be specified by a
  16.     logical.
  17.  
  18. (b) Call SYS$GETDVI with item code DVI$_DEVLOCKNAM to find the 16-byte device
  19.     lock name for the device name obtained in (a).
  20.  
  21. (c) Call SYS$ENQ to queue a lock on a resource whose name is concatenated as
  22.  
  23.         RMS$ + file ID + device lock name
  24.  
  25.     and receive a lock-id.
  26.  
  27. (d) Call SYS$GETLKI with item code LKI$_LOCKS, passing lock-id returned in
  28.     (c), in hope to get a list of RMS locks associated with the resource name
  29.     in (c).
  30.  
  31. (e) Print out PID, lock mode and queue for every lock in the list returned
  32.     in (d).
  33.  
  34.     I have coded a test program.  My questions are:
  35.  
  36. 1)  Can the above scheme work?  Is the basic idea correct?
  37.  
  38. 2)  Apparently I have no access to RMS locks in normal situation.  What
  39.     happen if I do (c) and (d) in EXEC mode (as same as RMS)?  If I queue
  40.     a lock in EXEC mode with a valid resource name of a RMS file lock, can
  41.     I block locks queued by RMS on the same file?  :-)
  42.  
  43. 3)  If I shall change mode and call SYS$CMEXEC (or SYS$CMKRNL), what is the
  44.     order of the argument list?  In the same order as in C or in a reversed
  45.     order?
  46.  
  47.     I would like to have your experts' opinions before I go further, I am
  48. a bit anxious about to shut down a busy system unwittingly.  Your help is
  49. highly appreciated.  I thank Dan Wing, Earl D. Lakia and Martin P.J. Zinser
  50. for their help on a previous request for lock utility.
  51.  
  52.  
  53. -- Sanyee Tang
  54.    BC Research
  55.    Vancouver, Canada
  56.  
  57.