home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21719 < prev    next >
Encoding:
Text File  |  1993-01-22  |  3.1 KB  |  73 lines

  1. Path: sparky!uunet!spool.mu.edu!sgiblab!adagio.panasonic.com!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: mailboxes with DCL?
  5. Date: 22 Jan 1993 12:44:08 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 59
  8. Distribution: world
  9. Message-ID: <1joq6oINN32k@gap.caltech.edu>
  10. References: <1993Jan21.032056.373@wega.rz.uni-ulm.de>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1993Jan21.032056.373@wega.rz.uni-ulm.de>, ORAKEL@rzmain.rz.uni-ulm.de (Framstag) writes:
  15. >I know, this topic has been discussed several times in the last years, but
  16. >I haven't saved these articles, because I wasn't interested in, and now I
  17. >need it:
  18. >
  19. >Some (easy, of course :-) ) examples of DCL programs handling with
  20. >mailboxes with normal user privs (netmbx,tmpmbx).
  21. >
  22. >What exactly I want: process-communication between a DCL-program running in
  23. >a detached (via run sys$system:loginout/input=...) or batch process and a
  24. >"user in front of his terminal".
  25. >
  26. >The user should be able to send DCL-commands via a mailbox to the
  27. >detached/batch program which scans, say... every 10 sec the mailbox and
  28. >then executes the command. It will not be necessary to return output to the
  29. >interactive user's terminal. (But nice, if :-) )
  30. >
  31. >example:     $ write mailbox: "@do_something"
  32. >or:          $ @mbox_frontend "backup d1: d2:"
  33. >
  34. >or something like that. I hope I have expressed myself clear enough - Carl,
  35. >don't beat me too hard ;-)
  36.  
  37. You can't create mailboxes from DCL.  You've got to write a program to create
  38. them (and, since you're probably restricted to creating temporary mailboxes,
  39. they go away, by default, at image rundown).  What you need to do is:
  40.     1)  Write a program that uses $CREMBX (use the command HELP SYS $CREMBX
  41.         for details) to create a mailbox, assigning to it a known logical
  42.         name, then reads a single record from it (sample program included
  43.         below); and
  44.     2)  Run that program from a spawned asynchronous subprocess, then use
  45.         the DCL OPEN command with the known logical name to assign a
  46.         channel to the mailbox from the parent process;
  47.     3)  Write a record to the mailbox (e.g., with the VMS COPY command);
  48. Or, you could simply have the subprocess sleep for long enough for you to
  49. assign the channel.  Here's the program to create the mailbox:
  50.  
  51. #include stdio
  52. #include descrip
  53. main()
  54. {    $DESCRIPTOR(lognam, "FUBAR");
  55.     unsigned short chan;
  56.     FILE *fp;
  57.     char buff[10];
  58.  
  59.     SYS$CREMBX(0, &chan, 0, 0, 0, 0, &lognam);
  60.     sleep(30);
  61.  
  62.     fp = fopen("FUBAR", "r");
  63.     fgets(buff, 10, fp);
  64. }
  65. --------------------------------------------------------------------------------
  66. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  67.  
  68. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  69. understanding of astronomy is purely at the amateur level (or below).  So
  70. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  71. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  72. hold me responsible for it, but my organization had nothing to do with it.
  73.