What Can Cause An Error 12 'ERR_FILE_CANT_OPEN'?

Godot Version

4.3

Question

I am working on a project which includes reading files and I am getting an error 12 when trying to read from one specific file, even though the path is known to be a valid absolute path from the (String).is_absolute_path() being checked as true before trying to open the file.

var file_path : String = "path" # path of the file
if file_path.is_absolute_path(): #checking its valid
	print(FileAccess.open(file_path, FileAccess.READ))
	# ^ prints '<Object#null>'
	print(FileAccess.get_open_error())
	# ^ prints '12'

What can cause a error 12 ‘ERR_FILE_CANT_OPEN’ to occur?

assuming you are trying to open it on windows:

1 Like

Thank you! I don’t know C++ so I am looking into and have asked about how it works to try and find the root of the problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.