How do I fix Parse Error: Identifier "File" not declared in the current scope?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alexMunro

I took the BeepSaber game, originally written for Godot 3.2 and converted it to Godot4 format using a recent build of Godot trunk. When I try to run the game, I get many gdscript errors. In the latest GDScript Reference, I see that the class File still exists.
So I think those errors will be fixed when adding a “extends Node” to the beginning of each file. Is this correct?

Godot Engine v4.0.beta.custom_build.0f8f0ab12 - https://godotengine.org
Vulkan API 1.2.195 - Using Vulkan Device #0: AMD - AMD RADV NAVI10

ERROR: Script does not inherit from Node: res://OQ_Toolkit/vr_autoload.gd.
at: start (main/main.cpp:2724)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/HighscoreTable/HighscoreTable.gd:104)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/HighscoreTable/HighscoreTable.gd:105)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/HighscoreTable/HighscoreTable.gd:118)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/HighscoreTable/HighscoreTable.gd:119)
ERROR: Script does not inherit from Node: res://game/scripts/HighscoreTable/HighscoreTable.gd.
at: start (main/main.cpp:2724)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/PlayCountTable.gd:74)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/PlayCountTable.gd:75)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/PlayCountTable.gd:88)
SCRIPT ERROR: Parse Error: Identifier “File” not declared in the current scope.
at: GDScript::reload (res://game/scripts/PlayCountTable.gd:89)
ERROR: Script does not inherit from Node: res://game/scripts/PlayCountTable.gd.
at: start (main/main.cpp:2724)
SCRIPT ERROR: Parse Error: Expected closing “)” after grouping expression.
at: GDScript::reload (res://OQ_Toolkit/vr_autoload.gd:748)
SCRIPT ERROR: Invalid call. Nonexistent function ‘initialize’ in base ‘Nil’.
at: _ready (res://GameMain.gd:8)

:bust_in_silhouette: Reply From: exuin

File has been renamed to FileAccess.

A few days later I already found out, my game port is making progress.
It can be found here: LibreVR/godot-xr-tools: godot-xr-tools containing a beepsaber port - godot-xr-tools - Codeberg.org

alexMunro | 2023-02-28 17:09