home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / perl / 8037 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.0 KB

  1. Path: sparky!uunet!ukma!hri.com!spool.mu.edu!sol.ctr.columbia.edu!news.unomaha.edu!cwis!mfuhr
  2. From: mfuhr@cwis.unomaha.edu (Michael Fuhr)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: mesg in perl
  5. Message-ID: <mfuhr.728264238@cwis>
  6. Date: 28 Jan 93 23:37:18 GMT
  7. References: <WEG.93Jan28170216@mace.cc.purdue.edu>
  8. Sender: news@news.unomaha.edu (UNO Network News Server)
  9. Distribution: comp
  10. Organization: University of Nebraska at Omaha
  11. Lines: 22
  12.  
  13. weg@mace.cc.purdue.edu (Eythan Weg) writes:
  14.  
  15. >Since there various implementation of unix mesg, I wonder if one can
  16. >write a version in perl.  If so, please give me some pointers.
  17.  
  18.  
  19. As far as I can tell, mesg simply changes the permissions on your
  20. terminal.  To do the equivalent of "mesg n" try:
  21.  
  22.     chop ($tty = `tty`);    # need to trim that trailing newline
  23.     chmod 0600, $tty;    # set permissions to rw-------
  24.  
  25. "mesg y" would be:
  26.  
  27.     chop ($tty = `tty`);
  28.     chmod 0660, $tty;    # set permissions to rw-rw----
  29.  
  30. This seems to work on my machine, but someone please let me know if I've
  31. overlooked something.
  32. --
  33. Michael Fuhr
  34. mfuhr@cwis.unomaha.edu
  35.