FileDialog path not showing C:/

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

I’m trying to make a 2D card editor where you can upload an image of your character, but i ran into an issue where the path would not show the base directory (C:/ , D:/ , etc) in the “current path” section. That caused Godot to not be able to load it. There’s no special code involved, but here are a couple of screenshots:

As you can see, there’s no “(letter)://” in the current path and dir. Is there a solution to this?

1 Like
:bust_in_silhouette: Reply From: Zylann

It looks like indeed current_path does not contain the drive, and there doesnt seem to be a way to get which drive is selected.

If you use the file_selected signal, this one will give you a valid path when the user chooses and validate a file.

You can also set the initial path from script and that should select the correct drive when the dialog opens.
However if you did intend to hardcode the path at which the dialog opens in editor, then it might fail to open that path cuz it saves no info about which drive to choose in tscn…
The closest issue I found on Github is 'FileDialog' always has the first driver selected no matter what · Issue #30872 · godotengine/godot · GitHub, but it still isn’t directly related so a new issue or proposal should be posted.