mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
[Web] Fix DirAccess::unlink()
not updating the IDBFS
This commit is contained in:
parent
aa8d9b83f6
commit
a6c5373a09
6 changed files with 31 additions and 5 deletions
|
@ -438,11 +438,19 @@ Error DirAccessUnix::remove(String p_path) {
|
|||
return FAILED;
|
||||
}
|
||||
|
||||
int err;
|
||||
if (S_ISDIR(flags.st_mode) && !is_link(p_path)) {
|
||||
return ::rmdir(p_path.utf8().get_data()) == 0 ? OK : FAILED;
|
||||
err = ::rmdir(p_path.utf8().get_data());
|
||||
} else {
|
||||
return ::unlink(p_path.utf8().get_data()) == 0 ? OK : FAILED;
|
||||
err = ::unlink(p_path.utf8().get_data());
|
||||
}
|
||||
if (err != 0) {
|
||||
return FAILED;
|
||||
}
|
||||
if (remove_notification_func != nullptr) {
|
||||
remove_notification_func(p_path);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool DirAccessUnix::is_link(String p_file) {
|
||||
|
@ -552,6 +560,8 @@ DirAccessUnix::DirAccessUnix() {
|
|||
change_dir(current_dir);
|
||||
}
|
||||
|
||||
DirAccessUnix::RemoveNotificationFunc DirAccessUnix::remove_notification_func = nullptr;
|
||||
|
||||
DirAccessUnix::~DirAccessUnix() {
|
||||
list_dir_end();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue