Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to delete first n lines from a logfile ??
Message
De
01/03/2006 08:59:13
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to delete first n lines from a logfile ??
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MySQL
Divers
Thread ID:
01100361
Message ID:
01100361
Vues:
59
Hello Everbody
I create logfile entrys with a routine like this

lsErrorLog = "c:\mylog.Log"
lhErrorLog = FOPEN(lsErrorLog, 12)

* create if not there
IF lhErrorLog < 0
lhErrorLog = FCREATE(lsErrorLog)
ENDIF


= FSEEK(lhErrorLog, 0, 2)
= FPUTS(lhErrorLog, "Datum : " + DTOC(DATE()) + " " + TIME())
= FPUTS(lhErrorLog, "Message : " + STR(tnError, 5) + " " + tsMessage)
= FPUTS(lhErrorLog, "Line : " + STR(tnLine, 5) + " " + tsLine)
= FPUTS(lhErrorLog, "Rechner : " + sys(0))
= FPUTS(lhErrorLog, "*******************************************************" )
= FPUTS(lhErrorLog, "")

* close
IF lhErrorLog >=0
= FCLOSE(lhErrorLog)
ENDIF

Now i want to delete the first 1000 lines from mylog.log when mylog.log has more then
5000 lines.

Can someone show me how to code this ??

Best regards
Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform