H5O2OH Posted June 25, 2008 Share Posted June 25, 2008 (edited) Hey, I made a server which is resending packets from a client to another server and modify some of the recv packets from the other server before they get to the client. The packets I get are a lot and most of them are most likely completely useless,instead WPE ,it would be easier to me if i could read them from a txt file without the useless packets. Well,I can add a if stringLeft($Packet... to ignore the useless data,but i've never worked with log files in au3,i could do it in delphi,but everything is easier in au3. So,basically i've got all running except the log function,please help. Edited June 25, 2008 by H5O2OH Link to comment Share on other sites More sharing options...
enaiman Posted June 25, 2008 Share Posted June 25, 2008 Here is what you're after: _FileWriteLog -------------------------------------------------------------------------------- Writes current date,time and the specified text to a log file. #Include <File.au3> _FileWriteLog($sLogPath, $sLogMsg[, $iFlag = -1]) Parameters $sFilePath Path and filename of the file to be written to $sLogMsg Message to be written to the log file $iFlag [Optional] - Flag that defines if $sLogMsg will be written to the end of file, or to the begining. If $iFlag = -1 (default) $sLogMsg will be written to the end of file. If $iFlag <> -1 $sLogMsg will be written to begining of file. Return Value Success: Returns a 1 Failure: Returns a 0 @Error: 0 = No error. 1 = Error opening specified file 2 = File could not be written to Help file quote. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
nobbe Posted June 25, 2008 Share Posted June 25, 2008 #include <file.au3> ; _FileWriteLog(@ScriptDir & "\my.log","Text 1") ; _FileWriteLog(@ScriptDir & "\my.log","Text 2") Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now