home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!hri.com!spool.mu.edu!sol.ctr.columbia.edu!news.unomaha.edu!cwis!mfuhr
- From: mfuhr@cwis.unomaha.edu (Michael Fuhr)
- Newsgroups: comp.lang.perl
- Subject: Re: mesg in perl
- Message-ID: <mfuhr.728264238@cwis>
- Date: 28 Jan 93 23:37:18 GMT
- References: <WEG.93Jan28170216@mace.cc.purdue.edu>
- Sender: news@news.unomaha.edu (UNO Network News Server)
- Distribution: comp
- Organization: University of Nebraska at Omaha
- Lines: 22
-
- weg@mace.cc.purdue.edu (Eythan Weg) writes:
-
- >Since there various implementation of unix mesg, I wonder if one can
- >write a version in perl. If so, please give me some pointers.
-
-
- As far as I can tell, mesg simply changes the permissions on your
- terminal. To do the equivalent of "mesg n" try:
-
- chop ($tty = `tty`); # need to trim that trailing newline
- chmod 0600, $tty; # set permissions to rw-------
-
- "mesg y" would be:
-
- chop ($tty = `tty`);
- chmod 0660, $tty; # set permissions to rw-rw----
-
- This seems to work on my machine, but someone please let me know if I've
- overlooked something.
- --
- Michael Fuhr
- mfuhr@cwis.unomaha.edu
-