home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!usenet-feed.cc.umr.edu!cnews
- From: mgj@franklin.ee.umr.edu (Mahesh Govind Joshi)
- Subject: How do I find out if a user is refusing messages ?
- Date: Thu, 27 Aug 1992 20:37:00 GMT
- Nntp-Posting-Host: franklin.ee.umr.edu
- Reply-To: mgj@ee.umr.edu (Mahesh Govind Joshi)
- Organization: University of Missouri - Rolla
- Sender: cnews@umr.edu (UMR Usenet News Post)
- Originator: mgj@ee.umr.edu
- Message-ID: <1992Aug27.203700.642@umr.edu>
- Lines: 43
-
- Hi,
-
- I dont know if this is the right newsgroup to ask this question
- but I will go ahead anyway.
-
- How do I find out if a person is refusing messages (mesg n) at
- a remote site through a 'C' program ?
- ( This includes checking if he is logged on !!).
-
- At present, I am doing this in a crude fashion. I dont know if
- a better method exists.
-
- argv[2] node_name (eg. ee.umr.edu)
- argv[1] username (eg. mgj)
-
-
- I do a system(" finger @argv[2] | grep argv[1] > /tmp/file ")
-
- I do a fgets(buf,35,file_pointer_to_/tmp/file).
- If fgets returns a NULL, person is not logged on.
- else
- check for the occurrence of '*' in this file
-
- if index(buf,'*') != NULL
- person is logged on but refusing messages
- else
- person is logged.
-
- This is very crude I beleive, but it works very well !
-
- Suggestions are welcome !!
-
-
- Thanks in advance!!
-
- ________________________________________________________________________
- Mahesh Joshi | Bura duniya ko hai kehta
- Help Desk Consultant | Aisa bhola to na ban
- Snail Mail:- 1300 N. Oak Street | Jo hai karta,woh hai bharta
- #17, Rolla MO 65401. | Hai yahan ka hai chalan
- Voice:(314)341-8197. | Takdeer nahi chalnegi yahan
- Email : mgj@ee.umr.edu | ---- Majrooh Sultanpuri----
- ------------------------------------------------------------------------
-