[solved] change_dir member in Directory class doesn't work properly or I'm doing something wrong?

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

I have the following code:

var dir = Directory.new()
var err = dir.change_dir("../")
print( "Err: " + str(err) )

And the output looks like:
Err:31
I looked at http://docs.godotengine.org/en/stable/classes/class_@global%20scope.html#class-global-scope and 31 is for ERR_INVALID_PARAMETER.

Late edit: I’m using godot 2.1.3 stable on win 64

Best regards,
Radu

:bust_in_silhouette: Reply From: radubolovan

Look line I needed to open a directory first.
The following code works fine:

print( "Data dir: " + OS.get_data_dir() )
dir.open(OS.get_data_dir())
err = dir.change_dir("../")
print( "Err: " + str(err) )
print( "Data dir: " + dir.get_current_dir() )