Hello Guest it is April 19, 2024, 11:01:00 AM

Author Topic: Lua append txt file  (Read 948 times)

0 Members and 1 Guest are viewing this topic.

Lua append txt file
« on: October 25, 2018, 01:16:56 PM »
   
   
Hello,

I try append on txt file, and there is a problem, if the file dont exist, this script create a file and write the message.

but if the file already exist, the File return a nil values, and dont append the message

File = io.open("C:/perfLogs/Log1.txt", "a+" )
File:write("test...")
File:close()


Is this code supposed to work for append mode? Why does not it work?

Any one?

Re: Lua append txt file
« Reply #1 on: October 26, 2018, 11:56:34 AM »


Solve,

The folder as to be maximum share permition.

it's a little weird because if the file does not exist the script creates a new one, but for some reason if it already exists, it's not possible to append.

Any way, solve.