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

  1. Path: sparky!uunet!darwin.sura.net!aplcen.apl.jhu.edu!wb3ffv!ka3ovk!nstar!ipact!lakia
  2. From: lakia@ipact.com
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Asynch. signal from VMS
  5. Message-ID: <1992Jul24.172304.90@ipact.com>
  6. Date: 24 Jul 92 17:23:04 CDT
  7. References: <DB15A146AEA19B12@SCS.SLAC.STANFORD.EDU>
  8. Organization: IPACT, Valparaiso IN
  9. Lines: 154
  10.  
  11. In article <DB15A146AEA19B12@SCS.SLAC.STANFORD.EDU>, LEVITT@SLC.SLAC.STANFORD.EDU (Stevie Boy) writes:
  12. > Does anyone know of a way to get some sort of asynchronous message from VMS
  13. > when a file is written to a directory?
  14.     You can turn on FAL$LOGGING and parse the resulting file.  The
  15. following file is what we use for a PDP and other devices to direct
  16. files to a printer on our VAX with diffrent forms.  The remote nodes
  17. simply use the following command in DCL.
  18.  
  19. $COPY filename.ext  IPACT"RUNOFF"::filename.form
  20.  
  21. Where form is:  LM5 (portrait left margin 5)
  22.         80  (portrait normal 80 character)
  23.         LM5S (portrait left margin 5, 132 characters)
  24.           (you get the idea)
  25.  
  26. This is the actual login.com command file for the runoff
  27. account on our VAX.  Note we use a lot of RUNOFF files from
  28. old PDP systems too, we actually do the runoff and print the
  29. resulting MEM file.
  30.  
  31. $!
  32. $! File:  LOGIN.COM (user: RUNOFF)
  33. $! Author:  Earl D. Lakia (IPACT)
  34. $! Date of Last update:  16-NOV-1991
  35. $!
  36. $! Abstract:
  37. $!
  38. $! This account is designed to be used for remote runoff requests.
  39. $!
  40. $!
  41. $IF F$MODE() .NES. "NETWORK" THEN GOTO INTER
  42. $!
  43. $! This command procedure is used to do a runoff of a file
  44. $! sent from anywhere from the network.  In particular, 
  45. $! this was written to get execute this from the non-vax
  46. $! nodes.
  47. $!
  48. $! First turn on FAL logging, redirect sys$output, and
  49. $! run FAL to recieve the file.
  50. $!
  51. $ DEFINE FAL$LOG 1
  52. $ PID=F$PID(CONTEXT)  ! FIND OUT OUR PID
  53. $ NAME= "TEMP"+PID+".LOG;"
  54. $ OPEN/WRITE/ERROR=ERRR FLL 'NAME'
  55. $ define netserver$timeout "0 0:0:0"
  56. $ ASSIGN FLL SYS$OUTPUT
  57. $!
  58. $! Finally get the runoff or listing file
  59. $!
  60. $ RUN SYS$SYSTEM:FAL.EXE
  61. $ CLOSE FLL
  62. $ ASSIGN SYS$ERROR SYS$OUTPUT
  63. $!
  64. $! Now scan our temporary file FLL and get the file
  65. $! that was just copied.
  66. $!
  67. $ OPEN/READ FLL 'NAME'
  68. $ FIND:
  69. $ READ/END_OF_FILE=DONE FLL REC
  70. $ SIZE=F$LENGTH(REC)
  71. $ IF SIZE .EQ. 0 THEN GOTO FIND
  72. $ GET =F$LOCATE("Resultant file: ",REC)
  73. $ IF GET .EQ. SIZE THEN GOTO FIND
  74. $ SET VERIFY
  75. $ ENDS=GET+16
  76. $ LFS= SIZE-ENDS
  77. $ INFILE=  F$EXTRACT(ENDS,LFS,REC)
  78. $!
  79. $! infile is our runoff, or print file 
  80. $!
  81. $SHOW SYM INFILE
  82. $ TYPE =F$PARSE(INFILE,,,"TYPE")
  83. $ IF TYPE .EQS. ".RNO" THEN GOTO RNOFIL
  84. $ IF F$LENGTH(TYPE) .LT. 6 THEN GOTO OLDWAY
  85. $ TYPE =F$EXTRACT(4,3, TYPE)
  86. $SHOW SYM TYPE
  87. $ LFS =F$LOCATE(";",INFILE) - 3
  88. $OLDWAY:
  89. $ OUTFILE =F$EXTRACT(0,LFS,INFILE)
  90. $SHOW SYM OUTFILE
  91. $ RENAME 'INFILE' 'OUTFILE'
  92. $ SHOW SYM TYPE
  93. $ IF TYPE .EQS. "132" THEN GOTO LST132
  94. $ IF TYPE .EQS. "H32" THEN GOTO LSTH32
  95. $ IF TYPE .EQS. "080" THEN GOTO LST080
  96. $ IF TYPE .EQS. "H80" THEN GOTO LSTH80
  97. $ IF TYPE .EQS. "LM5" THEN GOTO LSTLM5
  98. $ IF TYPE .EQS. "L5S" THEN GOTO LSTL5S
  99. $ IF TYPE .EQS. ".132" THEN GOTO LST132
  100. $ IF TYPE .EQS. ".H32" THEN GOTO LSTH32
  101. $ IF TYPE .EQS. ".080" THEN GOTO LST080
  102. $ IF TYPE .EQS. ".H80" THEN GOTO LSTH80
  103. $ IF TYPE .EQS. ".LM5" THEN GOTO LSTLM5
  104. $ IF TYPE .EQS. ".L5S" THEN GOTO LSTL5S
  105. $ PRINT/delete 'OUTFILE'
  106. $ GOTO FIND
  107. $!
  108. $! Runoff file
  109. $!
  110. $RNOFIL:
  111. $RUNOFF 'INFILE'
  112. $LISTFILE= F$PARSE(INFILE,,,"NAME")
  113. $PRINT/DELETE 'LISTFILE'.MEM
  114. $DELETE 'INFILE'
  115. $GOTO FIND
  116. $!
  117. $! 132 Character listing
  118. $!
  119. $LST132:
  120. $PRINT/delete/form=land 'OUTFILE'
  121. $GOTO FIND
  122. $!
  123. $! 132 Character listing
  124. $!
  125. $LSTH32:
  126. $PRINT/delete/form=lm5s/header 'OUTFILE'
  127. $GOTO FIND
  128. $!
  129. $! 80 Character listing
  130. $!
  131. $LST080:
  132. $PRINT/delete 'OUTFILE'
  133. $GOTO FIND
  134. $!
  135. $! 80 Character listing with header switch
  136. $!
  137. $LSTH80:
  138. $PRINT/delete/form=lm5/header 'OUTFILE'
  139. $GOTO FIND
  140. $!
  141. $! Output left margin five
  142. $!
  143. $LSTLM5:
  144. $PRINT/delete/FORM=LM5 'OUTFILE'
  145. $GOTO FIND
  146. $!
  147. $! Output left margin five 132 characters compressed print
  148. $!
  149. $LSTL5S:
  150. $PRINT/delete/FORM=LM5S 'OUTFILE'
  151. $GOTO FIND
  152. $!
  153. $! no more files
  154. $!
  155. $ DONE:
  156. $ CLOSE FLL
  157. $ DELETE 'NAME'
  158. $ PURGE NETSERVER.LOG/KEEP=3
  159. $ exit
  160. $ERRR:
  161. $ EXIT
  162. $INTER:
  163.