I am having a problem with command
local f = (io.open(‘test.txt’, “r”) ~= nil)
according to documentation this should return true if file exists and false it doesn’t.
BUT in ardupilot LUA it returns always true even if file doesn’t exist, I investigated more and I saw that it returns always a file and an adress not matter what, like it creates file, but I use only parameter “r”.
Can you please help me ? I need to check if the file exists in order to avoid overwrite data but create a similar like test_2.txt
The Lua engine used by ArduPilot is imperfect (and constantly improving, but you shouldn’t chase the latest dev versions for fixes unless you know exactly what you’re doing).
Stick with latest stable and follow Pete’s advice.