Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MangoTree |
Hi,
I have tried creating a folder (using GDscript) in the same directory as the exported Godot executable, however, I can’t get it to work. I’ve used things like
var dir=Directory.new()
dir.make_dir("res://test")
but that only works using the Godot editor and NOT the final executable. I’ve also tried changing res://
to user://
, but that doesn’t work either. Any clues as to how achieve this?
Thanks
you first have to open the base directory that you want to create a new one in:
dir.open("user://")
dir.make_dir("test")
Edit: actually that’s not true. just tested on mac and using dir.make_dir('user://test')
works fine. Do you see an error?
Eric Ellingson | 2019-07-12 22:10
Hey, thanks. I ran dir.make_dir('user://test')
in the the exported .exe (on Windows), but it’s still not creating a physical folder in the same directory (as the .exe file). I’m running Windows 8.1, so maybe it works on Windows 10.
I found a temporary workaround though: Specifying the absolute path to a directory (e.g. saving to Desktop) works fine, e.g. (“C:/Users/user/Desktop/test”).
MangoTree | 2019-07-13 00:08