What does File.open() returns?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mudley
:warning: Old Version Published before Godot 3 was released.

I am curious to know what does the function open() in File returns. I know it is an integer, but of what? My guess is for error checking, but then, why not return Error instead?

:bust_in_silhouette: Reply From: avencherus

Should be an Error which is an enumerated type. You can see in the code below it will return parameters invalid, can’t open file, and OK.

The enum can be seen here: