hag. os.path.getatime(...) buggue (renvoie mtime), -> remplac par le basique os.stat(...)[7]
darcs-hash:20000530225330-92525-b5f8a16129d5bb380452cd526cb286e061ecd3ad.gz
This commit is contained in:
parent
4d60087b27
commit
7cc445a6b2
1 changed files with 8 additions and 1 deletions
9
wwho.py
9
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 :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue