home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / callmon / callmon$resident.com < prev    next >
Text File  |  1996-08-06  |  2KB  |  81 lines

  1. $!  CALLMON - A Call Monitor for OpenVMS Alpha
  2. $!
  3. $!  File:     CALLMON$RESIDENT.COM
  4. $!  Author:   Thierry Lelegard
  5. $!  Version:  0.0
  6. $!  Date:     19-JUL-1996
  7. $!
  8. $!  Abstract: This command procedure finds all resident images in the
  9. $!            system and define a logical name for each of them. Because
  10. $!            of these logical names, all subsequent commands will use a
  11. $!            non-resident version of each image.
  12. $!
  13. $!            This command procedure is not really a part of CALLMON,
  14. $!            it is a useful utility before using CALLMON.
  15. $!
  16. $ on warning then goto exit
  17. $!
  18. $!  Generate a list of installed images in a temporary file
  19. $!
  20. $ listfile := sys$scratch:callmon$list'f$getjpi("","pid")'.tmp
  21. $ if f$search(listfile).nes."" then delete 'listfile';*
  22. $ define/user sys$output 'listfile'
  23. $ install list
  24. $!
  25. $!  Read the output of "install list" and find resident images
  26. $!
  27. $ file = ""
  28. $ defspec = "SYS$SYSTEM:.EXE;"
  29. $ open/read callmon$listfile 'listfile'
  30. $ list_loop:
  31. $   read/end=end_list_loop callmon$listfile line
  32. $   if f$length(line).eq.0 then goto list_loop
  33. $   !
  34. $   ! Process error messages
  35. $   !
  36. $   if f$extract(0,1,line).eqs."%"
  37. $   then
  38. $     file = ""
  39. $     write sys$error line
  40. $     goto list_loop
  41. $   endif
  42. $   !
  43. $   ! Process new directory name
  44. $   !
  45. $   if f$extract(0,1,line).nes." "
  46. $   then
  47. $     file = ""
  48. $     defspec = f$edit(line,"collapse")
  49. $     goto list_loop
  50. $   endif
  51. $   !
  52. $   ! Process new file name and version
  53. $   !
  54. $   if (line-";").nes.line then -
  55. $     file = f$element(0," ",f$edit(line,"trim,compress"))
  56. $   resident = (line-"Resid").nes.line
  57. $   protected = (line-"Prot").nes.line
  58. $   !
  59. $   ! Found a resident image. Protected images cannot be overriden.
  60. $   !
  61. $   if file.nes."" .and. resident 
  62. $   then
  63. $     file = f$parse(";",file,defspec)
  64. $     name = f$parse(file,,,"name")
  65. $     if protected
  66. $     then
  67. $       write sys$output "''name' is protected, no logical name defined"
  68. $     else
  69. $       write sys$output "''name' = ''file'"
  70. $       define/nolog 'name' 'file'
  71. $     endif
  72. $   endif
  73. $   goto list_loop
  74. $ end_list_loop:
  75. $!
  76. $ exit:
  77. $ set noon
  78. $ if f$trnlnm("callmon$listfile").nes."" then close callmon$listfile
  79. $ if f$search(listfile).nes."" then delete 'listfile';*
  80. $ exit 1
  81.