rizwan 0 Report post Posted December 14, 2005 When i restart my system the file is not appending I am using the following code $file = FileOpen("C:\tools\scripts\Logtime.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit FileWriteLine($file, "Start time is " & _NowTime()) Please advise Share this post Link to post Share on other sites
seandisanti 1 Report post Posted December 14, 2005 When i restart my system the file is not appending I am using the following code$file = FileOpen("C:\tools\scripts\Logtime.txt", 1); Check if file opened for writing OKIf $file = -1 Then MsgBox(0, "Error", "Unable to open file.") ExitFileWriteLine($file, "Start time is " & _NowTime())Please adviseit doesn't look like you're closing your file, but i don't know if that would cause the issue you're seeing. You may want to just use _FileWriteLog(), you can cut out some of your code that way... 1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz Share this post Link to post Share on other sites
rizwan 0 Report post Posted December 15, 2005 it doesn't look like you're closing your file, but i don't know if that would cause the issue you're seeing. You may want to just use _FileWriteLog(), you can cut out some of your code that way...Thanks for your help. actually using the fileclose function worked. I think fileclose should be required after a fileopen. Becuz currently if you goto autoit help it says fileclose is not necessary Share this post Link to post Share on other sites
seandisanti 1 Report post Posted December 15, 2005 Thanks for your help. actually using the fileclose function worked. I think fileclose should be required after a fileopen. Becuz currently if you goto autoit help it says fileclose is not necessaryyes, the current (beta) text reads:When finished working with a file, call the FileClose function to close the file. Autoit normally closes all files upon termination, but explicitly calling FileClose is still a good idea. 1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz Share this post Link to post Share on other sites
SmOke_N 199 Report post Posted December 15, 2005 It doesn't say that FileClose "is not necessary", it says for FileWriteLine() "If a filename is given rather than a file handle, the file will be opened and closed during the function call."... But you used FileOpen() with a "handle" ($file = FileOpen()... FileWriteLine($file), so it is neccessary and actually the examples for FileOpen() / FileWriteLine(), both show a FileClose() routine in them. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites