fix: fix VFS Delete op for Ramdisk driver

This commit is contained in:
2026-05-27 18:06:27 +02:00
parent 190b0f9364
commit 90788e842f
2 changed files with 38 additions and 21 deletions
@@ -108,14 +108,15 @@ void filemanager_finish_rename(FileManagerState* fm) {
filemanager_build_fullpath(new_path, 512,
fm->current_path, fm->rename_buf);
if (fm->is_dir[fm->rename_idx]) {
// Directory rename: copy recursively then delete old
if (filemanager_copy_dir_recursive(old_path, new_path))
filemanager_delete_recursive(old_path);
} else {
// File rename: copy then delete old
if (filemanager_copy_file(old_path, new_path))
montauk::fdelete(old_path);
if (montauk::frename(old_path, new_path) != 0) {
// Fall back to copy + delete for drivers that don't support rename
if (fm->is_dir[fm->rename_idx]) {
if (filemanager_copy_dir_recursive(old_path, new_path))
filemanager_delete_recursive(old_path);
} else {
if (filemanager_copy_file(old_path, new_path))
montauk::fdelete(old_path);
}
}
filemanager_read_dir(fm);