Topic was automatically imported from the old Question2Answer platform.
Asked By
hidemat
I was able to find the _File class under "core/bind/core_bind.h" and it seems to work for the most part but I don’t know how to write Ref<File> file = File::_new();, which I found on a GDNative plugin, in its Module equivalent.
Oh I actually figured it out. Please correct me if I’m wrong. The call that made it work for me was the following:
Ref<_File> file = Ref<_File>();
file.instance();
You can simplify it to:
Ref<_File> file;
file.instance();
Although in reality, _File exists only because it is an object wrapper around the real thing. If you write a module, you dont have to use that. You could use the real thing instead:
FileAccessRef f = FileAccess::open(path, FileAccess::READ);