Outputs the memory addres instead of the text

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

There is a code and a file that exists and lies in the same directory as the file.cs

    var FileTextDebug = new Godot.File();

	FileTextDebug.Open("names.txt", File.ModeFlags.Read);
	FileTextDebug.Close();
	GD.Print("Debug:" + FileTextDebug);

Instead of the text what’s inside names.txt, outputs this:

Debug:[_File:1480]

What ideas does anyone have?

Ready-made code after the response, maybe someone will need it:

	var FileTextDebug = new Godot.File();

	FileTextDebug.Open("names.txt", File.ModeFlags.Read);
	string DeugText = FileTextDebug.GetAsText();
	FileTextDebug.Close();
	GD.Print("Debug:" + DeugText);

Thanks for the answer: exuin

:bust_in_silhouette: Reply From: exuin

You probably want the File.get_as_text() method.