|
Post by chezzy on Mar 30, 2017 21:53:12 GMT
Hello, Im trying to write result of my ankulua script into file, but for some reason, it does not work.
This Lua works on my pc:
local hotovy = io.open("hotovyucty.txt", "a") hotovy:write("test") hotovy:close() This does not work on my phone using daemon
local hotovy = io.open("/sdcard/scripts/hotovyucty.txt", "a") hotovy:write("test") hotovy:close() Neither works this:
file = io.open(scriptPath() .. 'hotovy.txt', 'a') file:write("test") file:close()
|
|
|
Post by Mercobots on Mar 31, 2017 9:14:13 GMT
hello
try this and see if works
hotovy = io.open(scriptPath().."hotovyucty.txt", "a+")
hotovy:write("test")
io.close(hotovy) a+ Append mode with read mode enabled that opens an existing file or creates a new file.
|
|
|
Post by chezzy on Mar 31, 2017 11:24:32 GMT
Hello, that does not work also. Im gonna try it on different android device and see if I still have the same problem. I have tried one other script and shows message about read only file system.
|
|
|
Post by chezzy on Mar 31, 2017 12:02:24 GMT
Yeah so the problem is my device, on the different android device it works and writes to file.
|
|
|
Post by Mercobots on Mar 31, 2017 12:14:44 GMT
yes because you don't have write permission on the 1º device
|
|
|
Post by chezzy on Mar 31, 2017 15:31:00 GMT
Im trying to change it for whole day without any success, this is really weird, the file shows in explorer Permissions: -rw-rw---- so I guess I should be able to write into it, but no.
|
|
|
Post by chezzy on Mar 31, 2017 16:04:46 GMT
This is getting even more weird, I have just found that the scripts are actually writing to the file, but only when I access the files in my phone in explorer I can see that there is stuff written in them, when I access them from my pc or even copy them to my pc and open them, they are empty.
|
|
|
Post by chezzy on Mar 31, 2017 16:15:17 GMT
Ok I have finally solved my problem, I just have to restart the phone to see any changes in the files. Thanks for help farrusco.
|
|