2shady4u/godot-sqlite

GDSQLite Error: Can't open specified json-file, file does not exist or is locked

Opened this issue · 2 comments

Environment:

  • OS: Windows
  • Godot version: 4.3
  • godot-sqlite version: 4.4

Issue description:
Export to JSON file failed.

Steps to reproduce:
Create a JSON file at the path res://player.json and a database file at the path res://test_data.db. The code only contains the following:

func _ready() -> void:
	database = SQLite.new()
	database.path = "res://test_data.db"
	database.open_db()
	database.export_to_json("res://player.json")

However, an error occurs: GDSQLite Error: Can't open specified json-file, file does not exist or is locked, and the export was unsuccessful.

Strangely, when I export it as an .exe file, there's no error, and it successfully exports to the JSON file.

Minimal reproduction project:
Only the code snippet above is needed.

Additional context

Hello @BravoNiceCatch,

I am trying to replicate the issue, but I fail to get the same error to appear on my end.
The snippet you shared runs without issue on my end.

Is there any missing information that might help?

  • Do you have another process that is locking the player.json-file in some way?
  • ...any other information :)

Note to future self:
Maybe add a call to std::perror("Error"); to get better understanding of what went wrong.