From 7cc445a6b29defa1ce56f64906490b743febc632 Mon Sep 17 00:00:00 2001 From: krempp Date: Wed, 31 May 2000 00:53:30 +0200 Subject: [PATCH] hag. os.path.getatime(...) buggue (renvoie mtime), -> remplac par le basique os.stat(...)[7] darcs-hash:20000530225330-92525-b5f8a16129d5bb380452cd526cb286e061ecd3ad.gz --- wwho.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wwho.py b/wwho.py index 9a4e0e5b..d74aa657 100755 --- a/wwho.py +++ b/wwho.py @@ -5,6 +5,10 @@ import os,string,getopt,time,sys,struct DATE (2000 May 22 06:12:08) wfile : idem, except : [-a (access)] FILE + +ça marche. mais la recherche ds le wtmp pour construire _sessions_ est +pas du tout optimale -> lent pour un gros wtmp. +Améliorations à prévoir.. """ optlist, args = getopt.getopt(sys.argv[1:], "adlb:p:f:") @@ -33,7 +37,10 @@ if not datesec : if date : if string.lower(os.path.basename(sys.argv[0]))=="wfile.py" : datesec=os.path.getmtime(date) #modif time - if all_last : datesec=os.path.getatime(date) #access time + if all_last : #access time + datesec=os.stat(date)[7] + # datesec=os.path.getatime(date) #BUG ! donne mtime ! + all_last=0 print " Chosen file Time : %s" \ %time.ctime(datesec) else :