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