Hi every one,
I made my first game and wrote the below functions to read and write the game date
func fDict2JsonFile(dictIn:Dictionary,fileName:String=gMainFileName)->bool:
var file = File.new()
if file.open(fileName,File.WRITE)!=0:
print("Error opening file")
return false
file.store_line(to_json(dictIn))
file.close()
return true
func fReadJson2Dict(matchName:String="",seekNo:int=-1,fileName:String=gMainFileName)->Dictionary:
var file = File.new()
if !file.file_exists(fileName) || file.open(fileName, File.READ) != 0:
return {}
if matchName.empty():
return parse_json(file.get_line())
if seekNo!=-1:
file.seek(seekNo)
var line=parse_json(file.get_line())
if fFileLineCheck(line,matchName,file): return line
else:
while file.get_position() < file.get_len():
var line=parse_json(file.get_line())
if fFileLineCheck(line,matchName,file): return line
file.close()
return {}
read and write work correct when I'm in Godot, I mean when in programming and use F5 key...
but when I export a game, read and write not work in Linux, Android, and Windows platforms.
shall I consider any extra issue to serve this? is it a bug?
many thanks