Unix/Linux Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Keyboard Input

Programming


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-07-2008   -   Original Discussion by cpaquette
cpaquette's Unix or Linux Image
cpaquette cpaquette is offline
Registered User
 
Join Date: Apr 2008
Last Activity: 9 April 2008, 5:00 PM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Keyboard Input

Does anyone know how do you determine the user idle time of STDIN in order to log the user out for being idle too long. I would like to write a c program to do this but I it is not clear upon how to determine idle time from keyboard input. I have found that the "who.c" source file uses the last access time of the tty. Is there no other way than access and mod times to see if the user is writing to STDIN and at what time?

Thanks in advance.

Chris
Sponsored Links
    #2  
Old Unix and Linux 04-07-2008   -   Original Discussion by cpaquette
era's Unix or Linux Image
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks: 0
Thanked 11 Times in 9 Posts
Please don't double post. See the forum rules.

https://www.unix.com/shell-programmin...idle-time.html
Sponsored Links
    #3  
Old Unix and Linux 04-07-2008   -   Original Discussion by cpaquette
cpaquette's Unix or Linux Image
cpaquette cpaquette is offline
Registered User
 
Join Date: Apr 2008
Last Activity: 9 April 2008, 5:00 PM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I thought this would be the more appropriate forum since it is the programming forum. I did not know of its existence until now. There may be C programmers that do look at the scripting forum. You should have bitched at me earlier for posting in the wrong forum the first time. Someone must know the answer to this problem! Please Help!
    #4  
Old Unix and Linux 04-07-2008   -   Original Discussion by cpaquette
era's Unix or Linux Image
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks: 0
Thanked 11 Times in 9 Posts
The other forum was not precisely wrong, but double posting is against the rules. I'm not a moderator or anything, so don't pay any attention to me. Your question here is somewhat different than the first one anyway so maybe it's okay.

However, it's somewhat intriguing to think that there must be a better way, but the author of who.c choses not to use it. Could you elaborate on that train of thought, and maybe explain why you want to avoid using the tty access time?
Sponsored Links
    #5  
Old Unix and Linux 04-07-2008   -   Original Discussion by cpaquette
Franklin52's Unix or Linux Image
Franklin52 Franklin52 is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 24 December 2017, 9:47 AM EST
Location: The Netherlands
Posts: 7,747
Thanks: 139
Thanked 558 Times in 520 Posts
Double post, continu here:

https://www.unix.com/shell-programmin...idle-time.html

Thread closed.

Last edited by Franklin52; 04-07-2008 at 02:59 PM..
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Keyboard input question biopulse Shell Programming and Scripting 5 11-29-2010 01:41 AM
Testing for correct user input from keyboard Pauline mugisha UNIX for Dummies Questions & Answers 0 11-29-2009 07:16 PM
Detecting Keyboard Input without return ravneetd Programming 4 05-10-2007 08:58 AM
Don't show keyboard input on terminal marianor31 Shell Programming and Scripting 1 03-23-2007 07:54 PM
suppressing keyboard input anthreedhr Shell Programming and Scripting 1 10-21-2004 12:05 PM



All times are GMT -4. The time now is 04:10 PM.