how to put a program into .plan file

Paul John Falstad pfalstad at burn.Princeton.EDU
Sat Sep 29 03:45:38 AEST 1990


In article <10511 at panix.UUCP> jsb at panix.UUCP (J. S. B'ach) writes:
>In article <2782 at idunno.Princeton.EDU> subbarao at phoenix.Princeton.EDU (Kartik Subbarao) writes:
>)The "cool" way to do this is to set up your .plan as a named pipe with
>)/etc/mknod.
>)Then you simply write a C program that checks the status of the file,
>)to see whether someone (the fingerer) has opened it. Then simply
>)write your message to the named pipe. You can do many fancy things with this.
>And does this C program run all the time checking?
No.
																  Or does it sleep
>until fingered?

Yes.  It blocks until the file is opened.

					  Even in the latter case some system resources are 
>permanently tied up.  Now (as Emanuel Kant might say) if everyone were
>to do this, the entire process table would fill up!

True.  I wouldn't do this, but it is a neat hack.  This would take up
a lot of swap space and process table space.  Perhaps you could run it
just when you're logged on, and replace the named pipe with a
conventional .plan in your .logout.

Then again, someone at our site used to have a planserver that
would create a new .plan file every 5 seconds, inserting a new funny
quote each time.  This solution with the named pipes is DEFINITELY
preferable to that one, I'm sure you'll agree.

On this same subject:

In some article somewhere, Dan Bernstein writes:
>In article <2884 at idunno.Princeton.EDU> pfalstad at phoenix.Princeton.EDU (Paul John Falstad) writes:
>> Somebody just posted an 100+ line program that does much the same thing as
>> this (unless I'm missing something really obvious):
>  [ shell script deleted ]
>> Now what am I missing??? Why does this have to be so complicated????
>Error checking, a couple of extra features, and no wasted execs. If you
>don't want to check errors, write code for Berkeley. :-)

Oh, well, of course.  I was just demonstrating the principle.  If I had
a planserver, I'd probably make it a C program.  I was just showing that
a planserver does not have to be some complicated program with select(2)
and all that.  Some error checking and the extra features could have been
added to my shell script as well.  The wasted execs are a problem,
as they would be with any shell script.

Write code for Berkeley....  Hmmm....

--
Here is the address to complain to:
pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD CIS: 70016,1355
That address again,
sync at thumper.princeton.edu PLink:OHS738 GEnie:OHS738 CIS: 4128 143 1234 937



More information about the Comp.unix.programmer mailing list