Jump to content

How create a text file and write log into the created text file?


ITSky8
 Share

Recommended Posts

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

  • 1 month later...

..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

$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 by weaponx
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...