The folowing code below returns the same last access time of the tty i am writing to for every loop iteration, what just can't be true. What am I doing wrong? Is there any other way to get the last access time? anything faster,as I need to get the info many times ?
btw, what is the difference between last access time and last modifiaction time of a file?
Expand|Select|Wrap|Line Numbers
- my $curr_tty = `tty`;
- chomp($curr_tty);
- my $i = 1;
- while (1) {
- $curr_tty_time = (stat($curr_tty))[8];
- print "$i, $curr_tty_time\n";
- sleep 4;
- $i++;
- }
Thanks in advance for any help!