![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | 9BitStrider |
For some reason, I can’t delete files from the user:// directory in Godot Mono.
Directory d = new Directory();
File f = new File();
if(d.DirExists(path)) {
GD.Print(Name, "Save file directory was found.");
switch(f.FileExists(path + filename)) {
case true:
GD.Print(Name, "Save file found. Deleting...");
d.Remove(path + filename);
GD.Print(Name, "Save file was deleted!");
break;
case false:
GD.Print(Name, "Error. Save file doesn't Exist.");
break;
}
} else {
GD.Print(Name, "Error. Save file directory not found.");
}
It detects the directory and the file, but the file remains after using Remove(). Am I skipping something?
From the console window:
[11:31:26] [Load]: Save file directory was found.
[11:31:26] [Load]: Save file found. Deleting…
[11:31:26] [Load]: Save file was deleted!