home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!ulowell!woods.ulowell.edu!sabotkap
- From: sabotkap@woods.ulowell.edu
- Subject: Re: mailboxes with DCL?
- Message-ID: <1993Jan21.021820.1@woods.ulowell.edu>
- Lines: 53
- Sender: usenet@ulowell.ulowell.edu (News manager - ulowell)
- Organization: University of Lowell
- References: <1993Jan21.032056.373@wega.rz.uni-ulm.de>
- Date: Thu, 21 Jan 1993 07:18:20 GMT
-
- ORAKEL@rzmain.rz.uni-ulm.de (Framstag) requests:
- ->
- -> Some (easy, of course :-) ) examples of DCL programs handling with
- -> mailboxes with normal user privs (netmbx,tmpmbx).
- ->
-
- The following hack DCL procedure opens a channel to the mailbox created
- during a SPAWN, and keeps it open after the subprocess terminates.
- Note that processes reading/writing this mailbox could very easily end up
- hung waiting for the other processes' read/write, if the command procedures
- you are using to do the communications are not synchronized. Also, you
- will not be able to set the buffer size, protection mask, or other flags.
- All attributes of the mailbox are initialized when it is created via a
- SPAWN.
-
- ^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v^-v-^
- Pete Sabotka, Meteorology Dept. sabotkap@woods.ulowell.edu
- University of Massachusetts - Lowell
- "Days like this let you savor a bad mood." - Calvin (Calvin & Hobbes)
- ^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v^-v-^
- $! CREMBX.COM
- $! Creates a mailbox for DCL use
- $!
- $! parameters: p1 - logical name to open for mailbox
- $!
- $ if p1 .eqs. "SUB" then goto subprocess
- $Mainprocess:
- $ channel=p1
- $ if channel .eqs. "" then read sys$command channel/end=done/prompt="_Log name: "
- $ if channel .eqs. "" then goto Mainprocess
- $ program=f$environment("procedure")
- $ parent_pid=f$getjpi(0,"pid")
- $ spawn/nolog/nowait @'program' SUB 'parent_pid'
- $ set process/suspend/id=0
- $ spawn_pid=f$trnlog("SPAWN_PID")
- $ mbxnum=f$trnlog("MBXNUM")
- $ mailbox="MBA''mbxnum':"
- $ open/read/write 'channel' 'mailbox'
- $ stop/id='spawn_pid'
- $ deassign/job SPAWN_PID
- $ deassign/job MBXNUM
- $ w "Mailbox device ''mailbox' opened"
- $Done:
- $ exit
- $Subprocess:
- $ spawn_pid=f$getjpi(0,"pid")
- $ if p2 .nes. "" then resume_pid=p2
- $ mbxnum=f$getjpi(0,"TMBU")
- $ define/job/nolog SPAWN_PID 'spawn_pid'
- $ define/job/nolog MBXNUM 'mbxnum'
- $ set process/resume/id='resume_pid'
- $ set process/suspend/id=0
-
-