OK: 'problem' has gone away for me as I worked out a palliative approach.
if e == 1 then
local fp = io.open("A/CHDK/DATA/LBS.CFG")
local str = fp:read("*all")
fp:close()
temp = string.sub(str, 1, 1)
local con_fig = "A/CHDK/DATA/LBS."..temp
fp = io.open (con_fig,"r")
if fp == nil then
print("No ConFig file found")
return
else
str = fp:read("*all")
fp:close()
if string.find(str,"e=0") == nil then
str = string.gsub(str,"#e=1","#e=0")
fp = io.open (con_fig,"w")
fp:write(str)
fp:close()
os.remove("A/CHDK/LOGS/LOG_2306.TXT")
print("Log File Deleted")
return -- exit script
end
end
end