diikee Posted July 17, 2008 Share Posted July 17, 2008 I get more data on the Console than I get in the file. Is there a magic to flash all data out to the file???? Link to comment Share on other sites More sharing options...
Dead Posted July 17, 2008 Share Posted July 17, 2008 Could you post the code so we can see it Link to comment Share on other sites More sharing options...
Paulie Posted July 17, 2008 Share Posted July 17, 2008 I get more data on the Console than I get in the file. Is there a magic to flash all data out to the file????Well, obviously the problem is on line 26. muttley Link to comment Share on other sites More sharing options...
diikee Posted July 17, 2008 Author Share Posted July 17, 2008 (edited) What line 26??? $file = FileOpen("logfile_" &@MDAY &@MON &@HOUR &@MIN &"_" &$ip[$x] & ".txt", 9) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "SQA Testing IP#: " & $ip[$x] & @CRLF) FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF) FileClose($file) Edited July 17, 2008 by diikee Link to comment Share on other sites More sharing options...
diikee Posted July 18, 2008 Author Share Posted July 18, 2008 Anyone encountered such a problem before?? Link to comment Share on other sites More sharing options...
BrettF Posted July 18, 2008 Share Posted July 18, 2008 (edited) Any chance of a sample logfile? just make the IP 123.123.123.123 or something.... muttley Well using this script as my test: Dim $ip[1] = ["123.123.123.123"] $x = 0 $file = FileOpen("logfile_" & @MDAY & @MON & @HOUR & @MIN & "_" & $ip[$x] & ".txt", 9) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "SQA Testing IP#: " & $ip[$x] & @CRLF) FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF) FileClose($file) The logfile outputs: SQA Testing IP#: 123.123.123.123 SQA Testing Finished at: 190720080929 Exactly what you told the code to add... Is there something I'm missing? Edited July 18, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
diikee Posted July 18, 2008 Author Share Posted July 18, 2008 Yes, I am getting the log file populated as the test goes through all the cases. Problem is the Console is printing faster than the log file is been written to. Thus, ending up with a partial log. either the writefile is lagging behind or something. so, is there a way to enhance the writefile command to flush data to the file from the buffer faster?? Link to comment Share on other sites More sharing options...
BrettF Posted July 19, 2008 Share Posted July 19, 2008 (edited) Yes, I am getting the log file populated as the test goes through all the cases. Problem is the Console is printing faster than the log file is been written to. Thus, ending up with a partial log. either the writefile is lagging behind or something. so, is there a way to enhance the writefile command to flush data to the file from the buffer faster??I'm testing now, with the following: Dim $ip[1] = ["123.123.123.123"] $x = 0 For $i = 1 To 1000 $file = FileOpen("logfile_" & @MDAY & @MON & @HOUR & @MIN & "_" & $ip[$x] & ".txt", 9) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "SQA Testing IP#: " & $ip[$x] & @CRLF) FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF) FileClose($file) Next No missed beats. My output file has 2000 lines, exactly how many there should be. But, thats only 1 IP, and 1 Log. Now for 1000 Logs! $output = "" For $i = 1 To 1000 $ip = Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) $file = FileOpen("logfiles\logfile_" & @MDAY & @MON & @HOUR & @MIN & "_" & $ip & ".txt", 9) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "SQA Testing IP#: " & $ip & @CRLF) FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF) FileClose($file) Next Still all there, all the same size too.... There must be another part to your code thats causing this IMO. Otherwise maybe add a sleep here and there, so it catches up.... muttley EDIT: 100 logs? Pfft... I meant 1000! *Evil Laughter* EDIT 2: Why not test time while we're at it. This took 1584ms to execute 1000 logs. For 10,000 it took 17939ms. Both cases had the correct number of files. I still draw to my same conclusion that something else is causing this. $timer = TimerInit () $output = "" For $i = 1 To 1000 $ip = Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) & "." & Round (Random (100, 999),0) $file = FileOpen("logfiles\logfile_" & @MDAY & @MON & @HOUR & @MIN & "_" & $ip & ".txt", 9) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "SQA Testing IP#: " & $ip & @CRLF) FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF) FileClose($file) Next ClipPut (TimerDiff ($timer)) Edited July 19, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 24, 2008 Share Posted July 24, 2008 Log file has:Electronic Shutter is set to: fixed 1/6144 secElectronic Shutter is set to: fixed 1/4096 secElectronic Shutter is set to: fixed 1/2560 secElectronic Shutter is set to: fixed 1/2048 secElectronic Shutter is set to: fixed 1/1396 secElectronic Shutter is set to: fixed 1/960 secElectronic Shutter is set to: fixed 1/698 secElectronic Shutter is set to: fixed 1/480 secElectronic Shutter is set to: fixed 1/349 secElectronic Shutter is set to: fixed 1/240 secElectronic Shutter is set to: fixed 1/175 secElectronic Shutter is set to: fixed 1/120 secElectronic Shutter is set to: fixed 1/60 seConsole has:Electronic Shutter is to: fixed 1/6144 secElectronic Shutter is to: fixed 1/4096 secElectronic Shutter is to: fixed 1/2560 secElectronic Shutter is to: fixed 1/2048 secElectronic Shutter is to: fixed 1/1396 secElectronic Shutter is to: fixed 1/960 secElectronic Shutter is to: fixed 1/698 secElectronic Shutter is to: fixed 1/480 secElectronic Shutter is to: fixed 1/349 secElectronic Shutter is to: fixed 1/240 secElectronic Shutter is to: fixed 1/175 secElectronic Shutter is to: fixed 1/120 secElectronic Shutter is to: fixed 1/60 secElectronic Shutter is to: fixed 1/40 secElectronic Shutter is to: fixed 1/30 secElectronic Shutter is to: fixed 1/20 secElectronic Shutter is to: fixed 1/15 secElectronic Shutter is to: fixed 1/11 secElectronic Shutter is to: fixed 1/8 secElectronic Shutter is to: fixed 1/5 secwhat is the problem??You haven't given us any code that writes a log file like that. So we can't see the problem. Post a short reproducer script that we can run to see the problem. If you can't, it must your Reality Distortion Field (RDF)... hang out with Steve Jobs much? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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