[comp.unix.questions] Followup to *portable* process comunication question.

ruiu@tic.UUCP (Dragos Ruiu) (11/08/87)

This is a folowup to a question I posted a while back, asking if there was
a *truly* portable method to get processes to communicate on the variety of
different Un*xes out there.

I was looking for a way to emulate the VMS phone utility (called talk here
on unix). I have not included all the replies I received, only the ones
which were not duplicates. 

-Dragos

-------------------------------------------------------------------------------
Tue Nov  3 00:57 MST 1987
From: edson!alberta!Sun.COM!guy (Guy Harris)

If you really want *total* portability, files probably are the last resort.

However, note that many systems these days have picked up named pipes; System
III had them, System V kept them, and lots of people have added them to systems
that didn't start with System V code (we have them in SunOS, I believe DEC has
them in Ultrix, Apollo almost certainly has them in their DOMAIN/IX System V
(and maybe, if they were smart, in their DOMAIN/IX 4.2BSD as well)).

Note that named pipes don't work over a network, unless you have something such
as RFS and have a directory accessible to *all* hosts on your network
into which named pipes can be dropped, so absent that you can't make something
such as "talk" work over the network (which is a big win around here, since
most people have their own machines).
 
>     Barring that is there a method that will work on all SysV (V.2 V.3 ..)?

Named pipes.  Probably System V IPC (messages, shared memory, semaphores), as
long as support for them was configured into the kernel (it's a system
generation option).

>      Or is there a method to intercept *all* output to a tty so that a
> useable version of the VMS Phone utility may be written for Unix.

Not that I know of.  If you aren't interested in networked operation, you can
use "talk" on machines that support it (most machines running an OS that
started as 4.[23]BSD, and probably some machines running OSes that started as
System III or System V as well), and pick up one of the public-domain "talk for
System V" thingies posted to e.g. comp.sources.unix for other machines.

-------------------------------------------------------------------------------
Tue Nov  3 18:47 MST 1987
From: edson!alberta!ihnp4!ames!sdcsvax!sdeggo!dave (David L. Smith)

Well, files are probably the only "truly" portable method.  Pipes (not named,
just pipes) will work on everything too, but one process must be the child of 
the other in order to use them.  Named pipes do not exsist under Berkeley.

The Unix version of phone is called "talk" and it was originally a BSD program
but there must be at least 6 PD versions of it for Sys V including two I wrote
(one using named pipes and signals and another using message queues, which I'm
still testing).
---
David L. Smith
{sdcsvax!man,ihnp4!jack!man, hp-sdd!crash, pyramid}!sdeggo!dave
man!sdeggo!dave@sdcsvax.ucsd.edu 
The net.goddesses made me do it!
-------------------------------------------------------------------------------
Thu Nov  5 04:47 MST 1987
From: Angeli "Ms. Pepper" Wahlstedt<hpfcla!handel!wahlsted>

What a weird concidence....I'm working on almost the same thing -- the
Phone thingy for Unix! However, this will be written mostly for Berkeley 4.3,
because of the problems with portability, of course. (There IS a program
similar to Phone called "talk" on BSD 4.3, but it's limited to two-way
conversations only. And I want to make improvements on it to allow up to as
many users as a screen can support.)

But still, I would like to hear any replies that you got cuz you see, I'm
also working on a multi-user "write" system, not unlike the CB Simulation
on Compuserve and other commercial timesharing systems. And since at least
two people want a copy of that program, I've been figuring out how to make
it more efficient and yet portable enough at the same time. At this point,
I'm using a shared file and writing to "/dev/ttys", which does work but
accesses the shared file too often for comfort.

Hopefully awaiting a reply,

Angeli Wahlstedt
Colorado State University

UUCP: ihnp4!hpfcla!handel!wahlsted
Internet: wahlsted@handel.colostate.edu
Bitnet: PEPPER@CSUGREEN
-------------------------------------------------------------------------------
ihnp4!hotps!tsdiag!fc Thu Nov  5 09:47 MST 1987

I've just read your news article. I gather what you are looking for is a
way to communicate with another user without having to use "write". Well,
I just happen to have a public domain utility called 'talk'. This utility
creates two virtual screens on the terminals being used. The upper portion
of the terminal contains 'your' writing pad. The lower one has the messages
being typed in by the other user. There is no need to hit a carriage return
for your message to appear on the others terminal. Messages are transfered
character by character. TALK accomplishes this two way communication using
pipes. This is in my opinion, the easier way to handle it. If you'd like
you can attempt to read another terminal by manipulating the terminal 
settings via a 'C' ioctl call. But, this can be complicated since you need
to know some hardware characteristics about the terminal you wish to talk
to. In order to use talk you need to have the curses library on your system.
Talk creates the virtual screens using curses. Let me know if you're
interested.

//Felix Cabral//
-------------------------------------------------------------------------------
From: richard@islenet.UUCP (Richard Foulk)
Date: 4 Nov 87 06:17:38 GMT

A small mod to write(1) to make it use cbreak (or whatever) mode is
much better than chat or talk or any of the others I've seen.  It's
simple and easy to follow, no over's or o-o's necessary.

The bsd talk(1) is cute but it's a pain to follow with the cursor
jumping back and forth.  And it's impossible to reconstruct the
conversation by looking at the screen.

-- 
Richard Foulk		...{dual,vortex,ihnp4}!islenet!richard
Honolulu, Hawaii
-------------------------------------------------------------------------------

Again, thanks to all who replied.