ITSky8 Posted February 22, 2008 Share Posted February 22, 2008 Hello! How create a text file and write log into the created text file? 1. Check if the log.txt file is existing or not? 2. If exit, then write the defined content into the log.txt in replacement methd e.g. Content in log.txt is OK Just update OK or Problems Link to comment Share on other sites More sharing options...
weaponx Posted February 22, 2008 Share Posted February 22, 2008 #include <File.au3> _FileWriteLog ( $sLogPath, $sLogMsg ) Link to comment Share on other sites More sharing options...
Aassdd Posted February 22, 2008 Share Posted February 22, 2008 "1. Check if the log.txt file is existing or not?" If FileExists($sLogPath) = 0 Then FileCreate($folder_path & "\Log.txt") or If FileExists($sLogPath) = 0 Then MsgBox(0, "Error", "Log file does not exist.") or whatever. Link to comment Share on other sites More sharing options...
rich96 Posted April 9, 2008 Share Posted April 9, 2008 ..NOOB ALERT.. Trying to write the results of an array to a log file but it's writing nothing. Apparently I'm missing something.. $FileList=_FileListToArray("C:\Lanvera") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _FileWriteLog("C:\Lanvera\Log" & "\my.log",$FileList) _ArrayDisplay($FileList,"$FileList") should I put a loop into the script?? much appreciated... Link to comment Share on other sites More sharing options...
weaponx Posted April 9, 2008 Share Posted April 9, 2008 (edited) $FileList=_FileListToArray("C:\Lanvera") If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf For $X = 1 to $FileList[0] _FileWriteLog("C:\Lanvera\Log" & "\my.log",$FileList[$X]) Next _ArrayDisplay($FileList,"$FileList") Edited April 9, 2008 by weaponx Link to comment Share on other sites More sharing options...
rich96 Posted April 9, 2008 Share Posted April 9, 2008 right on worked perfect.. thanks a lot Weaponx sniper... 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