[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

179.0. "DCL and Mailboxes" by VAXUUM::DYER () Tue Dec 03 1985 17:11

	    So, does anybody know how to write to and read from mail-
	boxes from a DCL command procedure?
			<_Jym_>
T.RTitleUserPersonal
Name
DateLines
179.1PARVAX::PFAUTue Dec 03 1985 20:015
Use the OPEN, READ and WRITE commands.  :-)

Is your real question how to create the mailbox in the first place?

tom_p
179.2VAXUUM::DYERTue Dec 03 1985 20:062
	    Ayuh.
			<_Jym_>
179.3SANFAN::THOMASMAWed Dec 04 1985 07:117
First, don't use mailboxes, use pipes (from DEC/SHELL).

$ OPEN/WRITE pipe _PIPE0:	! create a new pipe from the template device
$ SPAWN/INP='F$GETDVI("pipe","DEVNAM")'/OUT=NL:  whatever
$ WRITE pipe "junk"

Get the idea?
179.4VAXUUM::DYERWed Dec 04 1985 12:352
	    What about the poor folks who don't have DEC/Shell?
			<_Jym_>
179.5NACHO::CONLIFFEWed Dec 04 1985 12:431
re .4 :  Let them eat cake
179.6SPRITE::OSMANWed Dec 04 1985 13:5325
O.K.  if you want the cake, you can try my ALLTALK tool, available in the shed.

Once you have it, you can say this:

	$ @alltalk (/input=my_log_in /output=my_log_out)
	Password:

You can then send input to the process that alltalk created for you, by saying:

	$ write my_log_in . . .

Then, you can read anything that the process types with

	$ read my_log_out . . .

This is kind of like mailboxes, but maybe even better, since the
stuff you read back includes even prompts (such as "$ " and "MAIL>")
that mailboxes don't normally detect.

If you try this, was it helpful ?  Did it work for you ?

/Eric

p.s.	If this is overkill, you may study alltalk.com.  It creates a mailbox,
	so you could see how it does it.
179.7RANI::LEICHTERJWed Dec 18 1985 02:3432
Really, using BLISS just to create a mailbox?  A REAL hacker does it all in
DCL.

WARNING!  Heavy hacking ahead.  Do this stuff wrong, and your process is
likely to hang (at least on V3 - V4 may do better, though I doubt it).

Suppose your current PID is in symbol pid.  You do a SPAWN.  A mailbox will
get created, with job-wide logical DCL$ATTACH_'pid' pointing to it.  That
mailbox is used to pass messages to the current process when it comes time to
awaken it as the result of an ATTACH or LOGOUT.  A similar mailbox and logical
is created when you ATTACH away from a process.

Now, you don't want to mess with DCL$ATTACH_'pid', since you may very will
want to attach back to this process at some point in the future; so you need
to get a mailbox for a process you care nothing about.  So, do the following:

	$ spawn/process=foo_'pid' @foo 'pid'

where FOO.COM is:

	$ mypid = f$getjpi("","PID")
	$ define/job NEW_PID 'mypid'
	$ attach 'p1'

When the original process resumes execution, do:

	$ open/read/write mbx DCL$ATTACH_'f$trnlnm("NEW_PID")'
	$ deassign/job NEW_PID
	$ stop foo_'pid'

and go for it.
							-- Jerry
179.8SPRITE::OSMANWed Dec 18 1985 12:4314
Jerry, first of all, ALLTALK actually gives you more powerful channels
than mailboxes because a) prompts appear, and b), even programs like PHONE
or VNOTES are happy with ALLTALK's channels, they don't complain about you
"not being on a terminal".

Secondly, last time I tried your DCL mailbox trick, the resultant mailbox
ended up too skimpy.  That is, if I sent it anything larger than 16, count
'em, 16, bytes long, everything hung.

I haven't studied this latest hack.  Have you solved the skimpyness problem,
or is it the same thing masquerading in another note file :-) ?

/Eric

179.9RANI::LEICHTERJSun Dec 29 1985 23:2811
The BLISS program is just there to make a mailbox - I know you actually do
most of the stuff through PCA's.

The limitation is on the maximum buffering set aside when the mailbox is created
(either maxmsg or bufquo in the $CREMBX call).  It's POSSIBLE to make things
work within the limits DCL sets up - after all, DCL does! - though it may be
tricky.

All in all, though, it IS just a hack -  sad that there is no CREATE/MAILBOX,
isn't it?
							-- Jerry
179.10New attemptNY1MM::BERGFri May 16 1986 21:0016
    
    	  I finally got tired of this stuff, so I created a DCL mailbox
    	command called MBX.  This works like a CREATE/MAILBOX call (syntax:
    
    		MBX[/delete]	log_name[/PERM][/TERM][/SIZE]
    	).  Some of the advantages of this approach are:
    
    		- It is an image and does not require subprocess
    		  creation.
    		- It can be installed with PRMMBX priv for this image
    		  only, or installed with TMPMBX, or simply run by an
    		  individual user.
    		- If a temporary mailbox is created the program does
    		  a SYS$WAITFR until someone reads/writes the mailbox.
    
    	If anyone is interested contact me at NY1MM::[BERG].
179.11[RE .10]: Should It Be Part of VMS DCL?VAXUUM::DYERIceberg or volcano?Mon May 19 1986 02:324
	    [RE .10]:  You might want to pass this idea along to VMS
	development.  Drop the suggestion (and offer your prototype
    	as a demonstration) in the BULOVA::VMSPHASE0 conference.
			<_Jym_>
179.12Don't keep it a secret!METOO::LAMIAMon May 19 1986 16:183
    [re .10]
    
    How's about submitting it to the TOOLSHED (:^)?