home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / vms / 12684 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  3.6 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!SLC.SLAC.STANFORD.EDU!LEVITT
  2. From: LEVITT@SLC.SLAC.STANFORD.EDU (Stevie Boy)
  3. Newsgroups: comp.os.vms
  4. Subject: RE. Asynch. signal from VMS
  5. Message-ID: <439F1466BEA1CD80@SCS.SLAC.STANFORD.EDU>
  6. Date: 22 Jul 92 19:35:00 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 53
  11.  
  12. Here is a summary of various suggestions I received regarding getting an
  13. aynchronous signal from VMS whenever a file is written to a directory:
  14.  
  15. 1. Poll for files, process them and then move them to reduce the ammount of
  16.    polling done. I thought about having a logical name PCDIR defined as two
  17.    directories [.TO_DO] & [.DONE] so that the PC could write to and read from
  18.    a single "directory" and be oblivious to the movement of the files. The 
  19.    problem is that although the pathworks "USE" command interprets PCDIR, it
  20.    only yields the first directory it defines. Shame. Still, this method has
  21.    the advantage of simplicity, it gives a handshake capability between the PC
  22.    and the VAX, and the system clocks of the VAX & PC don't have to
  23.    be synchronised as they would if you were to look at file modification time.
  24.    Thanks to both Jim Agnew AGNEW@RUBY.VCU.EDU 
  25.    and Brian Cuttler SYSBRC@ALBNYVMS.ALBANY.EDU
  26.  
  27. 2. Enable ACL alarms on the directory and use the audit server to kick my
  28.    server program. The idea is you create a mailbox and wait for audit
  29.    messages to come in. The SET AUDIT/LISTENER=steve_mbx command will direct a
  30.    copy of all audit messages to the mailbox. The drawback is that ALL audit
  31.    messages arrive, and you have to filter them. There is even an example of
  32.    this mechanism: (at least our installation) SYS$EXAMPLES:AUDSRV_LISTENER.B32
  33.    Thanks to Chris Chiesa CHRIS_F_CHIESA@CUP.PORTAL.COM 
  34.    and Nigel Arnot NRA@IPG.PH.KCL.AC.UK
  35.  
  36. 3. VMS takes out a kernel mode lock on the directory when writing into it.  You
  37.    can let your application take out an exclusive lock on the directory, release
  38.    the lock when it receives a blocking ast, and process the new files when it
  39.    regains the lock.  You can take similar locks on the single files in the
  40.    directory.  The easiest way to find the lock used is through the statistics
  41.    block, you can get from the XCP when you use the QIO interface described I/O
  42.    Users manual.  The FCB field refers the FCB, that contains a field, which
  43.    contains the lock id.  You will need SYSLCK and CMKRNL to do the trick.
  44.    Karsten Nyblad sent me some Bliss 32 code for this, so thanks are
  45.    due to him KARSTEN@TFL.DK
  46.  
  47. 4. Investigate the details of the lock database which RMS uses
  48.    to synchronize access to files. You'll probably need the Files-11 internals
  49.    book if you decide to try this. It MIGHT be possible to set up a lock of
  50.    your own on the .DIR, with a blocking AST. Whem RMS wants to create a file,
  51.    your blocking AST goes off, you downgrade your lock to null, RMS does its
  52.    stuff, you upgrade your lock back to exclusive-write and then scan for the
  53.    new file. Of course, this is assuming that RMS will wait while you un-block,
  54.    rather than immediately giving a "file locked by another user" error.
  55.    Thanks to Nigel Arnot NRA@IPG.PH.KCL.AC.UK
  56.  
  57. Well folks, there you have it - it can be done, but not neccessarily easily.
  58. Thanks again to those who replied.
  59.  
  60. --------------------------------------------------------------------------------
  61. Disclaimer: Any ignorance expressed here is my own. It does not imply
  62.             ignorance on the part of SLAC, Stanford University or the DoE.
  63. --------------------------------------------------------------------------------
  64.  
  65.