[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

671.0. "MAIL from .EXE" by FOO::BHAVNANI (Must be the compiler...) Thu Jan 21 1988 03:06

	You  guys  are  such a helpful lot, I couldn't resist asking another
	question:  is there a  (relatively)  painless  way to send mail from
	within a program without causing the program to end (LIB$DO_COMMAND)
	and  without  using LIB$SPAWN (too slow).  I also need to keep track
	of  the  send attempt status (no such node, no such user, login info
	invalid at remote node, etc).  For now I'm @ing a .COM file in batch
	using  $SNDJBC (tnx, Rick!), but I was hoping to do away with queues
	altogether.

	Tnx for any ideas.
	/ravi
T.RTitleUserPersonal
Name
DateLines
671.1DYO780::DYSERTBarry DysertThu Jan 21 1988 12:129
    There is a callable interface to VMSmail, but it is not support
    in VMS v4.x.  It may be supported in v5, but of course I don't know.
    You might try asking in BULOVA::VMSMAIL.

    If you can't go the callable route, you may consider doing a LIB$SPAWN
    at image startup, always keeping the subprocess around. The subprocess
    would then post a read to a mailbox. Whenever you want to send mail,
    just write the stuff into the mailbox and have the dedicated,
    already-existing subprocess do the dirty work for you.
671.2Since this is the HACKERS conference...JON::MORONEY-- swapped out --Thu Jan 21 1988 12:524
(-: Of course, you could always convert the DCL 'anonymous mail' utilities
in this conference into your favorite language... :-)

-Mike
671.3PASTIS::MONAHANI am not a free number, I am a telephone boxThu Jan 21 1988 15:0612
    	I would strongly suggest that .2 is the way to go. The MAIL-11
    protocol is well defined and stable, since it is supported by RSTS,
    RSX, Ultrix, ...
    
    	It is also ridiculously simple. The fact that it is easy to
    implement it in DCL shows this, but high level languages like Macro or
    Focal can do reads and writes too if you get bored with DCL.
    
    	Don't try to use MAIL for the mail protocol. It does not give you a
    detailed error status unless you force it to write its error message to
    a file and then parse it. By that time you might as well have got the
    message directly from the remote object.
671.4WINERY::THOMASThe Code WarriorThu Jan 21 1988 23:513
    Or pretend you are MAIL and invoke NMAIL to send it.  Load NM_MAILSHR
    via LIB$FIND_IMAGE_SYMBOL and then simulate the MAIL$PROTOCOL
    interface.
671.5Possible referenceINFACT::NORTHERNAnd who shoved you in the pool?Fri Jan 22 1988 02:1113
    Don't have a copy of it, but in (it seems like), the last year,
    they had a basic program that did exactly that in the VAX professional.
    
    Of course, they were hacking VMS mail protocols to try and send
    bogus messages, but there is nothing that says you can't use the
    same techniques for legitimate purposes.
    
    Also, I believe in the fiche  relating to VMSmail, there should
    be something there called PROTOCOL.TXT, which describes mail
    protocols...
    
    
    				- Lou
671.6Anon Mail RoutineFOO::BHAVNANIMust be the compiler...Fri Jan 22 1988 03:516
	Re  .2 and .3, can you give me a pointer to the anon mail rtn?
	I've only just begun to get into the RTL and sys services, and
	all this is immensely exciting.  Now if I only *knew* more....

	Tnx for all your replies.
	/ravi
671.7Night mode = fast cyclesFOO::BHAVNANIMust be the compiler...Sat Jan 23 1988 06:567
	These late night hacks are habit forming.   I *love* night mode!
	Am putting the finishing touches on my program.  Hope to have an
	alfa test version by the end of the week.  Boy, it sure is quiet
	at DLB....

	Tnx for all your help.
	/ravi
671.8@ a .COM file from a detached processFOO::BHAVNANIMust be the compiler...Sat Jan 23 1988 07:5612
Oh well, it was good while it lasted...

Is there any work-around for this problem?  I need to invoke a .COM file from
within my pgm, as in $SPAWN /NOWAIT.  I can do this with no problems if I $RUN
my pgm interactively or in batch.

However, if I $RUN /DETACH it (which is what I'd like to do), LIB$SPAWN dies
with an LIB$_NOCLI error.  The RTL manual says that an image run as a detached
or spawned process doesn't have a CLI.

Tnx,
/ravi
671.9PASTIS::MONAHANI am not a free number, I am a telephone boxSat Jan 23 1988 10:279
    	This has been discussed before, but LOGINOUT.EXE is the only thing
    in the system that knows (or should know) how to start up a CLI for a
    process, and a CLI is the only thing that knows how to handle things
    that are options of SPAWN like passing the CLI symbol table.
    
    	Either your main process has to have a CLI, which means you have to
    have run LOGINOUT there, or you have to create your subprocess with
    $creprc, and then run LOGINOUT there so it can load a CLI to handle the
    .COM file.